Thank you I am using version 6, but when I try using the template, the second table appears below the first, even though its title appears in the expected location. Am I missing something?
This is my excel.view.php file.
<?php
use \koolreport\excel\Table;
$sheet1 = "Pass Sales Report";
?>
<meta charset="UTF-8">
<meta name="description" content="Pass Sales Report">
<meta name="creator" content="PAYCE Technology Parking Management">
<meta name="title" content="Pass Sales Report">
<div sheet-name="<?php echo $sheet1; ?>">
<?php
$name = $this->params['empInfo']['first'] . " " . $this->params['empInfo']['last'];
$startD = date('m/d/Y', strtotime($this->params['start']));
$startT = date('H:i a', strtotime($this->params['start']));
$endD = date('m/d/Y', strtotime($this->params['end']));
$endT = date('H:i a', strtotime($this->params['end']));
if ($startD == $endD) {
$shift = "$endD $startD - $endD";
}
else {
$shift = "$startD $startT - $endD $endT";
}
$styleTitle = [
'font' => [
'name' => 'Calibri', //'Verdana', 'Arial'
'size' => 25,
'bold' => TRUE,
'italic' => FALSE,
'underline' => 'none', //'double', 'doubleAccounting', 'single', 'singleAccounting'
'strikethrough' => FALSE,
'superscript' => FALSE,
'subscript' => FALSE,
'color' => [
'rgb' => '000000',
'argb' => 'FF000000',
]
],
'alignment' => [
'horizontal' => 'center',//left, right, center, centerContinuous, justify, fill, distributed
'vertical' => 'top',//top, center, justify, distributed
'textRotation' => 0,
'wrapText' => FALSE,
'shrinkToFit' => FALSE,
'indent' => 0,
'readOrder' => 0,
],
'borders' => [
'top' => [
'borderStyle' => 'none', //dashDot, dashDotDot, dashed, dotted, double, hair, medium, mediumDashDot, mediumDashDotDot, mediumDashed, slantDashDot, thick, thin
'color' => [
'rgb' => '808080',
'argb' => 'FF808080',
]
],
//left, right, bottom, diagonal, allBorders, outline, inside, vertical, horizontal
],
];
$styleSection = [
'font' => [
'name' => 'Calibri', //'Verdana', 'Arial'
'size' => 20,
'bold' => TRUE,
'italic' => FALSE,
'underline' => 'none', //'double', 'doubleAccounting', 'single', 'singleAccounting'
'strikethrough' => FALSE,
'superscript' => FALSE,
'subscript' => FALSE,
'color' => [
'rgb' => '000000',
'argb' => 'FF000000',
]
],
'alignment' => [
'horizontal' => 'center',//left, right, center, centerContinuous, justify, fill, distributed
'vertical' => 'top',//top, center, justify, distributed
'textRotation' => 0,
'wrapText' => false,
'shrinkToFit' => false,
'indent' => 0,
'readOrder' => 0,
],
'borders' => [
'top' => [
'borderStyle' => 'none', //dashDot, dashDotDot, dashed, dotted, double, hair, medium, mediumDashDot, mediumDashDotDot, mediumDashed, slantDashDot, thick, thin
'color' => [
'rgb' => '808080',
'argb' => 'FF808080',
]
],
//left, right, bottom, diagonal, allBorders, outline, inside, vertical, horizontal
],
];
$styleUnderline = [
'font' => [
'name' => 'Calibri', //'Verdana', 'Arial'
'size' => 20,
'bold' => TRUE,
'italic' => FALSE,
'underline' => 'none', //'double', 'doubleAccounting', 'single', 'singleAccounting'
'strikethrough' => FALSE,
'superscript' => FALSE,
'subscript' => FALSE,
'color' => [
'rgb' => '000000',
'argb' => 'FF000000',
]
],
'alignment' => [
'horizontal' => 'left',//left, right, center, centerContinuous, justify, fill, distributed
'vertical' => 'top',//top, center, justify, distributed
'textRotation' => 0,
'wrapText' => false,
'shrinkToFit' => false,
'indent' => 0,
'readOrder' => 0,
],
'borders' => [
'bottom' => [
'borderStyle' => 'thin', //dashDot, dashDotDot, dashed, dotted, double, hair, medium, mediumDashDot, mediumDashDotDot, mediumDashed, slantDashDot, thick, thin
'color' => [
'rgb' => '000000',
'argb' => 'FF000000',
]
],
//left, right, bottom, diagonal, allBorders, outline, inside, vertical, horizontal
],
];
?>
<div range="A1:O1" excelstyle='<?php echo json_encode($styleTitle); ?>' >Cashier Shift Report</div>
<div cell="A4" excelstyle='<?php echo json_encode($styleSection); ?>' >Name:</div>
<div cell="B4" range="B4:D4" excelstyle='<?php echo json_encode($styleUnderline); ?>' ><?php echo $name; ?></div>
<div cell="C4" excelstyle='<?php echo json_encode($styleUnderline); ?>' ></div>
<div cell="D4" excelstyle='<?php echo json_encode($styleUnderline); ?>' ></div>
<div cell="F4" excelstyle='<?php echo json_encode($styleSection); ?>' >Shift:</div>
<div cell="G4" range="G4:J4" excelstyle='<?php echo json_encode($styleUnderline); ?>' ><?php echo $shift; ?></div>
<div cell="H4" excelstyle='<?php echo json_encode($styleUnderline); ?>' ></div>
<div cell="I4" excelstyle='<?php echo json_encode($styleUnderline); ?>' ></div>
<div cell="J4" excelstyle='<?php echo json_encode($styleUnderline); ?>' ></div>
<div cell="L4" excelstyle='<?php echo json_encode($styleSection); ?>' >Bank:</div>
<div cell="M4" range="M4:N4" excelstyle='<?php echo json_encode($styleUnderline); ?>' ></div>
<div cell="N4" excelstyle='<?php echo json_encode($styleUnderline); ?>' ></div>
<div cell="A6" range="A6:E6" excelstyle='<?php echo json_encode($styleSection); ?>' >Cash/Credit Card Payments</div>
<div cell="A7">
<?php
Table::create(array(
"dataSource" => $this->dataStore('tickets'),
"showHeader" => true, //default: true
"showBottomHeader" => false, //default: false
"showFooter" => true, //default: false
"map" => [
"header" => function($colName) {
$returnNames = array("pay_method"=>"Paid By", "Number"=>"Qty", "Value"=>"Value", "Cash"=>"Cash Collected", "CC"=>"Credit Card",);
return $returnNames[$colName];
},
"bottomHeader" => function($colName) { return $colName; },
"cell" => function($colName, $value, $row) { return $value; },
"footer" => function($colName, $footerValue) { return $footerValue; },
],
"excelStyle" => [
"header" => function($colName) {
return [
'font' => [
'italic' => false,
'bold' => true,
'color' => [
'rgb' => '000000',
]
],
];
},
"bottomHeader" => function($colName) { return []; },
"cell" => function($colName, $value, $row) {
return [
'font' => [
'color' => [
'rgb' => '000000',
]
],
];
},
"footer" => function($colName, $footerValue) { return []; },
]
));
?>
</div>
<div range="G6:K6" excelstyle='<?php echo json_encode($styleSection); ?>' >Pass Sales</div>
<div cell="G7">
<?php
Table::create(array(
"dataSource" => $this->dataStore('tickets'),
"showHeader" => true, //default: true
"showBottomHeader" => false, //default: false
"showFooter" => true, //default: false
"map" => [
"header" => function($colName) {
$returnNames = array("pay_method"=>"Paid By", "Number"=>"Qty", "Value"=>"Value", "Cash"=>"Cash Collected", "CC"=>"Credit Card",);
return $returnNames[$colName];
},
"bottomHeader" => function($colName) { return $colName; },
"cell" => function($colName, $value, $row) { return $value; },
"footer" => function($colName, $footerValue) { return $footerValue; },
],
"excelStyle" => [
"header" => function($colName) {
return [
'font' => [
'italic' => false,
'bold' => true,
'color' => [
'rgb' => '000000',
]
],
];
},
"bottomHeader" => function($colName) { return []; },
"cell" => function($colName, $value, $row) {
return [
'font' => [
'color' => [
'rgb' => '000000',
]
],
];
},
"footer" => function($colName, $footerValue) { return []; },
]
));
?>
</div>
</div>