Export to PDF the results with search criterai
Export to PDF the results with search criterai
Hi,
I am trying to export to PDF the results of a filtered database. Everything is working well exept that I can't find a way to export to the PDF, above the table, the list of all the columns with a filtered criteria (name of the column: entered value by the user).
I am using the script in this exemple : https://datatables.net/extensions/fixedheader/examples/options/columnFiltering.html
In this exemple, if in the column NAME I enter "AI" and in the column POSITION I enter "ER", it will be filtered with three results, no problem to export it, but I need also to add in the PDF :
NAME = AI
POSITION = ER
Thanks a lot for your help
Regards
Answers
Use the
messageTop
option ofpdfHtml5
. It can be given as a function so you can query the document to find out what filters are applied and modify your message as needed.Allan
Hi Allan,
Thanks for your feedback.
For people who may be interested, here is the piece of code I use :
The s variable is only to be able to add an s if plural.
Then when configuring pdfmake, I create a header, in the header I added a table, where I simply put the rslt text.
It is very simple, but hard to find ;-)
Now I am looking for a way to export in PDF NO RECORD without any table when the filters show no results !!!!! Still not found ;-)