excel export with multiple sheets consider filder and render
excel export with multiple sheets consider filder and render

I'm using the solution from @you2525 for excel export with multiple sheets
The export works very well but exports all blank data and doesn't consider render and filter used on the datatable. Is there a way to export that as shown in the table?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
In the
getTableData
function thetable.rows().every(
part could be changed to be:to get just the filtered data. The code following that could also be modified if you want to get rendered data rather than the raw data for the row.
Allan
Thanks works very well.
Do you also have a short example for rendered data? And I also have a multiple selection on the datatable when I select some rows in PDF export only that ones are exported. Is it also possible for Excel export?
You are largely reimplement what Buttons already has here - I'd suggest looking at using the
buttons.exportData()
method (it wasn't available back when the example you are working off was originally created). It can be used to orthogonal export and getting selected rows only.Allan
Thank you for suggestion. It gave me the hint what needs to be change.
I changed in the
getTableData
function thetable.rows().every(
part to: