Ok gang, working on export to pdf, create table looks like this:
Table::create(array(
"dataSource"=>$this->dataStore('paybyp2'),
"columns"=> [
"HAS_COMMNTS"=>[
"label"=>"",
'formatValue'=>function($value, $row, $cKey) {
if($row["HAS_COMMNTS"] == "*"){
return '<i class="far fa-plus-square expand-collapse-detail-icon" aria-hidden="true"></i>';
}else{
return '';
}
}
],
"STR_ID"=>[
"label"=>"Store",
"format"=>"string"],
"USR_ID"=>[
"label"=>"User ID",
],
"PERIOD_DT"=>[
"label"=>"Clock Date",
"displayFormat"=>"m-d-Y"
],
"SEQ_NO_CLCK_IN"=>[
],
"SEQ_NO_CLCK_OUT"=>[
],
"DISP_CLCK_IN"=>[
"label"=>"Clock In",
],
"DISP_CLCK_OUT"=>[
"label"=>"Clock Out",
],
"IsHoliday"=>[
"label"=>"Holiday",
'formatValue'=>function($value, $row, $cKey) {
if($row["IsHoliday"] == 1){
return 8;
}else{
return 0;
}
}
],
"BREAK_TIM"=>[
"label"=>"Breaks",
"formatValue" => function($value, $row, $cKey) {
return max(number_format($value/60, 3, '.', ','),0);
//return ($row['MINUTES_WRKD'] + $row['PTO_TO_PAY']) - $row['BREAK_TIM'];
},
],
"MEAL_TIM"=>[
"label"=> $this->dataStore("mealspd")->only("MEAL_BRK_PD")->data()[0]["MEAL_BRK_PD"] == 'Y' ? "Meals(pd)" : "Meals",
"formatValue" => function($value, $row, $cKey) {
if($this->dataStore("mealspd")->only("MEAL_BRK_PD")->data()[0]["MEAL_BRK_PD"] == 'Y'){
return max(number_format($value/60, 3, '.', ','),0);
}else{
return 0;
}
//return ($row['MINUTES_WRKD'] + $row['PTO_TO_PAY']) - $row['BREAK_TIM'];
},
],
"PTO_TO_PAY"=>[
"label"=>"PTO",
"formatValue" => function($value, $row, $cKey) {
return max(number_format($value/60, 3, '.', ','),0);
//return ($row['MINUTES_WRKD'] + $row['PTO_TO_PAY']) - $row['BREAK_TIM'];
},
],
"MINUTES_WRKD"=>[
"label"=>"Hours Worked",
"formatValue" => function($value, $row, $cKey) {
return max(number_format($value/60, 3, '.', ','),0);
//return ($row['MINUTES_WRKD'] + $row['PTO_TO_PAY']) - $row['BREAK_TIM'];
},
],
"USRNAME"=>[
"label"=>"user",
"visible"=>false
],
"TOTALPD"=>[
"label"=>"Total",
"formatValue" => function($value, $row, $cKey) {
//return max(number_format($value, 2, '.', ' '),0);
$hol = $row['IsHoliday'] == 1 ? 480 : 0;
return number_format((($row['MINUTES_WRKD'] + $row['PTO_TO_PAY'] + $hol) - $row['BREAK_TIM'])/60,3,'.',',');
},
],
],
"grouping"=>array(
"USRNAME"=>array(
"calculate"=>array(
"{sumAmount}"=>array("sum","MINUTES_WRKD")
),
"top"=>"<b> {USRNAME}</b>",
"bottom"=>"<td><b>Total {USRNAME}</b></td><td><b>{sumAmount}</b></td>",
),
),
"sorting"=>array(
"USRNAME"=>"asc"
),
"showFooter"=>true,
"cssClass"=>array(
"table"=>"table-bordered",
"tf"=>"darker"
)
));
When I click the button to export to browser, the report shows up with data but the column labels do not show and i get the following php error:
[03-Sep-2022 12:10:29 America/New_York] PHP Notice: Undefined index: USRNAME in C:\inetpub\wwwteam\koolreport\pro_5.16.2\koolreport\core\src\widgets\koolphp\Table.php on line 397
[03-Sep-2022 12:10:29 America/New_York] PHP Warning: array_merge(): Expected parameter 1 to be an array, null given in C:\inetpub\wwwteam\koolreport\pro_5.16.2\koolreport\core\src\widgets\koolphp\Table.php on line 397
[03-Sep-2022 12:10:29 America/New_York] PHP Notice: Undefined index: MINUTES_WRKD in C:\inetpub\wwwteam\koolreport\pro_5.16.2\koolreport\core\src\widgets\koolphp\Table.php on line 397
[03-Sep-2022 12:10:29 America/New_York] PHP Warning: array_merge(): Expected parameter 1 to be an array, null given in C:\inetpub\wwwteam\koolreport\pro_5.16.2\koolreport\core\src\widgets\koolphp\Table.php on line 397
I get this for each column listed - The columns are correct, any idea why this is happening?