Hi,
I have a report with more then 50 columns. I am trying to export it to PDF as A4 landscape. but I have two issues: 1. When rows overflow the A4 page it is cut in the next page. no option to use page-break because all the table is printed in one time. 2. Trying to fit the width of the table to the page width but without success.
//MyReport.view.php
use \koolreport\datagrid\DataTables;
?>
<html>
<head>
</head>
<body DIR="RTL" style="margin:0.2in 0.2in 0.2in 0.2in">
<div class="row d-print-none">
<div class="col text-center">
<button id="print" class="btn btn-success" href="<?php echo site_url('reports'); ?>" onclick="javascript: window.print()">
<?php echo lang('tts.print'); ?>
</button>
<a class="btn btn-secondary mr-2" href="<?php echo site_url('reports'); ?>">
<?php echo lang('tts.back'); ?>
</a>
</div>
</div>
<?php
echo '<div class="header print-only"><img src="'.site_url('../assets/img/'.(isset($_SESSION['institute_number']) ? $_SESSION['institute_number'].'.png' : "logo.svg")).'" height="38" /></div>';
?>
<h1 class="text-center"><?php echo lang('tts.report_teachers_attendance'); ?></h1>
<h3 class="text-center"><u><?php echo lang('tts.for_month').' '.lang('tts.'.date('F', mktime(0, 0, 0, $this->month, 10))).' '.$this->year; ?></u></h3>
<?php
DataTables::create(array(
"name" => "myTable",
"dataSource"=>$this->dataStore("st"),
"fastRender" => true,
"options"=>array(
"order"=>[],
'columnDefs' => array(
array(
'visible' => false,
//'targets' => [$this->monthDays+6], //hide the first column
)
),
),
'complexHeaders' => true,
'headerSeparator' => ' - ',
// 'cssClass'=>array(
// 'table'=>'table table-bordered',
// 'tr'=>'cssItem',
// 'td'=>function($row,$colName)
// {
// return in_array($colName, array('teacher_id','id_number', 'reason')) ? 'text-right' : 'text-center';
// },
// 'th'=>function($colName)
// {
// return in_array($colName, array('teacher_id','id_number','reason')) ? 'table-dark text-right' : 'table-dark text-center';
// },
// ),
));
echo '<div class="footer print-only">Footer</div>';
?>
</body>
</html>