hi, i'm using excel package to export data from array to xlsx, the file was generated successfully, but the result has 2 sheet like this
the resulting sheet name doesn't match the name I defined. and I didn't set the chart_data sheet anywhere, but it was created automatically, I want to delete it.
here is my code:
public function settings()
{
return array(
"dataSources" => [
"paramData" => array(
"class" => '\koolreport\datasources\ArrayDataSource',
"data" => $this->params,
"dataFormat" => "associate",
)
]
);
}
public function setup()
{
$this->src('paramData')
->pipe($this->dataStore('exceldata'));
}
this is the excel view:
<?php
use \koolreport\excel\Table;
$sheet1 = "EXCEL REPORT AUTOMAIL";
?>
<meta charset="UTF-8">
<meta name="description" content="<?php echo $sheet1; ?>">
<meta name="keywords" content="Excel,HTML,CSS,XML,JavaScript">
<meta name="subject" content="<?php echo $sheet1; ?>">
<meta name="title" content="<?php echo $sheet1; ?>">
<meta name="category" content="category1">
<!-- sheet 1 -->
<div sheet-name="<?php echo $sheet1; ?>">
<div>
<?php
Table::create(array(
"dataSource" => $this->dataStore("exceldata"),
"rowHeight" => function($row, $rowIndex) {
// return 'auto';
return 10 * ($rowIndex + 1); # ---> not working?
},
"columnWidth" => function($columnName, $columnIndex) {
if ($columnName === "voucher_type") return '10';
else return 'auto'; # ---> not working?
},
"excelStyle" => [
"columnAutoSize"=> true,
"header" => function($colName) {
return [
'font' => [
'italic' => false,
'bold' => true,
'color' => [
'rgb' => '000000',
]
],
'alignment' => [
'horizontal' => 'center',//left, right, center, centerContinuous, justify, fill, distributed
'vertical' => 'center',//top, center, justify, distributed
'textRotation' => 0,
'wrapText' => false,
]
];
},
]
));
?>
</div>
</div>