Custom Toolbar Not Visible on Export
Custom Toolbar Not Visible on Export

We have created two custom toolbars in version 1.10 of Datatables
Our code looks like this:
.DataTable({
dom: '<"toolbar"><"toolbar2">Bfrtip',
...
});
$("div.toolbar").html('<b>THIS IS TOOLBAR!</b>');
$("div.toolbar2").html('<b>THIS IS TOOLBAR2!'</b>');
When using buttons to export the report (print, pdf, excel, etc.) the toolbars are not included.
Is there a way to include the toolbars?
Answers
Datatables only exports the row data, header and footer of the table. You can customize the output. Possibly using one of the message options shown in this example will work. Or you will need to use the
customize
function of each button to place the toolbars into the exported document. See this PDF example . Look at the docs of the particular HTML5 export buttons that you are interested in for more info about the specificcustomize
function for each button type. Also you can find other customization examples.Kevin
I created a test case but could not get the buttons to display for whatever reason. But essentially when I click the buttons to export the table, I need the custom toolbars to also be displayed. The examples you provided above helped me with a separate issue I was having but I am still unable to get those toolbars into the report when exported.
https://live.datatables.net/revemoke/1/edit?html,js,output
I used the Download Builder to generate the required include files for the export buttons to use in the test case. I added
messageTop
as a function, as shown in this example, to get the toolbars. I only updated the Print button.https://live.datatables.net/revemoke/2/edit
Kevin