DataTables row details information not appearing in TableTools PDF and XLS export
DataTables row details information not appearing in TableTools PDF and XLS export
I am using Datatables (v 1.10.2) and TableTools (v 2.2.3) to render a report. The main row has aggregate data for categories and subcategories. The row expands on click event as explained in example (https://datatables.net/examples/api/row_details.html) and displays details about category and subcategory in HTML table layout. One of the business requirement is to be able to export data in PDF and XLS format. We are using TableTools actively in entire application, but in aforementioned use case TableTools just exports row data. Row details/Child row data is missing from export even though they appear on screen.
I tried deferRender:true but it does not seem related to issue. Is there a callback I can use to make sure that row and row details/child row data gets exported in PDF and XLS format as shown in example (https://datatables.net/examples/api/row_details.html)? Our product stake holders like the performance of datatables for this use case and would like to use it for other reports in application.
Please feel free to send a note in case of any additional questions.
Answers
I had the same issue. I had to override the _fnGetDataTablesData function. To start I added the call to my function into the column definition.
I ended up passing my header rows (the dataTable) and my child row JSON data separately. The rows in my table are organized by different product types.
I hope this helps.
Hello Peterson,
I trust you doing well. In this article
You have used a variable childRows. Where are you getting its contents?
Regards,
Felix