Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
im using both print option like this:
"options"=>array(
"paging"=>false,
"searching"=>false,
"dom" => 'Bfrtip',
"buttons" => [
"excel", "print" // it has same result
],
"buttons" => [ // with this option
"excel",
[
"extend" => "print",
"customize" => "function(win)
{
var last = null;
var current = null;
var bod = [];
var css = '@page { size: portrait; }',
head = win.document.head || win.document.getElementsByTagName('head')[0],
style = win.document.createElement('style');
style.type = 'text/css';
style.media = 'print';
if (style.styleSheet)
{
style.styleSheet.cssText = css;
}
else
{
style.appendChild(win.document.createTextNode(css));
}
head.appendChild(style);
}"
],
]
),
DataTables' Print button is a client-side solution that only print the table with their own style, not the whole report with user's custom style. If you want to print the report exactly like it looks pls use our Export or CloudExport package which uses a headless browser to render the whole page to pdf like what you see on browser:
https://www.koolreport.com/docs/export/get_started/
https://www.koolreport.com/docs/cloudexport/chromeheadlessio/
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo