Is there a way for Export to Excel to include info and infoFiltered?
Is there a way for Export to Excel to include info and infoFiltered?
badijd
Posts: 9Questions: 4Answers: 0
Looking for a way when a user uses the Export to Excel option, that the Info (ex: Showing 1 to 17 of 17 records) and the infoFiltered (ex: Showing 1 to 2 of 2 records (filtered from 17 total records)) is included.
This question has accepted answers - jump to:
Answers
Use
page.info()
to get that info. UsemessageTop
ormessageBottom
as a function to get thepage.info()
then place it in the export where desired. See this example.Kevin
Thank you kthorngren! I was able to get this to work; however, I feel there has to be something to make it a bit easier.
In the export button I call a function:
This can be expanded to display the following:
Exported 17 records
If I am using searchPanes or Search and export the results I want to display:
Exported 2 records (filtered from 17 total records)
How do I capture when the view has been filtered?
Use
recordsDisplay
to determine if there are filtered records. Something like this:https://live.datatables.net/veluwize/1/edit
Kevin
Thank you for the quick response. Works perfect!