It's taking an unusually long time to generate a pdf with a size of 1mb. Upwards to 1 minute. Using DataTables built in pdf export button will generate the same report in just 1-3 seconds. I'm using "useLocalTempFolder" => true
.
and I can see the time between the tmp folder zip 611d68b4231b8
, 611d68b4231b8.zip
being generated and the final pdf output to be around a minute.
Any advice on how I can speed things up?
this is my ReportPDF.view.php
<?php
use koolreport\datagrid\DataTables;
?>
<html lang="en-US">
<head>
<link rel="stylesheet" type="text/css" href="global-theme.css?ver=<?= ASSET_VERSION ?>"/>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<?php
echo $_SESSION['export_pdf_html_header'];
?>
</head>
<body>
<style>
.print_head {
margin-bottom: 20px;
margin-top: 7px;
color: #666 !important;
}
h6{
padding-left: 20px;
}
.print_title {
font-weight: bold;
font-size: 17px;
}
.titleInfo {
padding-left: 20px;
}
.company_logo {
height: 30px;
}
.column-left{ float: left; width: 33.333%; }
.column-right{
float: right;
width: 33.333%;
padding-left: 450px;
}
.column-center{
display: inline-block;
width: 33.333%;
padding-left:175px;
}
.table th, .table td{
padding: 10px 5px 10px 5px !important;
}
@media print{
* {
-webkit-print-color-adjust: exact !important;
}
@page {
size: landscape;
}
}
#table_footer td:first-child{
background: black;
color: #374354 !important;
}
.table th,#table_footer td{
background: #374354 !important;
color: white !important;
}
.table-striped > tbody > tr:nth-of-type(odd) > td {
background-color: #f9f9f9 !important;
}
</style>
<input type='hidden' id='footer_value' name='footer_value' value='<?php echo $_SESSION['footer_value']?>'>
<?php
DataTables::create($_SESSION['data_table_array']);
?>
<script>
const footer_val = $('#footer_value').val()
if(footer_val == 1){
$('tbody tr:last').attr('id','table_footer');
}
</script>
</body>
</html>
The $_SESSION['data_table_array']
is something like:
$data_table_array = array(
'name' => 'reportTable',
'dataSource' => $table_data,
"cssClass" => array(
"table" => "display table table-striped table-bordered",
"th" => "reportTableHeader",
"tr" => 'reportTableRow',
'td' => "reportTableCell",
"tf" => 'reportTableFooter'
),
"options" => array(
"ordering" => FALSE,
"dom" => 'rt',
),
);
where $table_data
is just an array.