Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
I am using Apache. For example botstrap class name text-danger which makes the text in color red when I render the report inside my chrome I see the result BYT wen the same report is exported as PDF it is not shown. you can see the pdf_view code below:
<?php
//MyReport.view.php
use \koolreport\widgets\koolphp\Table;
?>
<html>
<head>
<title><?php echo lang('tts.report_teacher_hours_utilized'); ?></title>
</head>
<body DIR="RTL" style="margin: 25px 15px 25px 15px;" class="bg-transparent">
<div class='page-header' style='width: 100%; height:30px'>
<img style="float: right;" src="<?php echo site_url('../assets/img/'.(isset($_SESSION['institute_number']) ? $_SESSION['institute_number'].'.png' : "logo.svg")); ?>" height="38" />
</div>
<div class="responsive">
<?php
echo '<h1 class="text-center pb-1">'. lang('tts.report_teacher_hours_utilized').'</h1>';
Table::create(array(
"dataSource"=>$this->dataStore("st"),
"cssClass"=>array(
"table"=>"table-bordered text-center",
"th"=>"table-dark text-center",
'td'=>function($row,$colName)
{
//return $colName == 'teacher_id' ? 'text-right' : 'text-center';
switch ($colName) {
case 'teacher_id':
return 'text-right';
break;
case 'total_hours':
return ($row["total_hours"] < $row["utilized"]) ? "text-center bg-danger" : "";
break;
case 'utilized':
return ($row["total_hours"] > $row["utilized"]) ? "bg-warning" : "";
break;
default:
break;
}
},
),
"sorting"=>array(
"teacher_id"=>"asc",
),
"columns"=>[
"teacher_id",
"total_hours"=>[
"formatValue"=>function($value,$row) {
return ($row["total_hours"]<$row["utilized"]) ? "$value <i class='fas fa-exclamation-triangle'></i>" : $value;
}
],
"sheet_hours",
"utilized"=>[
"formatValue"=>function($value,$row) {
return ($row["total_hours"]>$row["utilized"]) ? "$value <i class='fas fa-exclamation-triangle'></i>" : $value;
}
],
"reward_hours",
"non_schedulable"
]
));
?>
<div class='page-footer' style='height:20px; width: 100%'>
<div class="footer" style="width:50%; float: left;"><?php echo lang('tts.print_footer'); ?></div>
<span style="float: right;"><?php echo lang('tts.page'); ?> {pageNum}/{numPages}</span>
</div>
</body>
</html>
Hi, pls try this approach:
$report-run()->export("MyReportPDF")
->settings([
'useLocalTempFolder' => true
])
->pdf(...)
Then look for a .tmp file in the tmp subdirectory in your report directory and open it as a text file. Look for the link tag with src path to bootstrap.css or bootstrap.min.css. Try to open/curl that path on your server and see if it works. Let us know the result. Tks,
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo