Hi Daniel,
We've checked Excel package and confirmed that as of the latest release the Excel's Table widget is limited to not being able to set column's meta directly, i.e "columns" can only contain a list of column names:
\koolreport\excel\Table::create(array(
...
"columns" => ["Column_1", "Column_2", ...],
...
));
To set the column's meta properties like "label", "type" you would have to set them on the datastore before. For example, in a report's setup:
//MyReport.php's setup()
...
->pipe(new ColumnMeta(array(
"Column_1" => array(
"label" => "Column 1"
),
)))
->pipe($this->dataStore("myDs"));
or directly in an excel template:
//MyReportExcel.view.php
<?php
$ds = $this->dataStore("myDs");
$meta = $ds->meta();
//Modify column meta
$meta["columns"]["Column_1"] = [
"label" => "Column 1"
];
//Set modified meta back to datastore
$ds->meta($meta);
\koolreport\excel\Table::create(array(
"dataSource" => $ds,
"columns" => ["Column_1", "Column_2", ...],
...
));
Please try these approaches and let us if it works for you or not.
To save users from this hassle, the next version of Excel package is going to add support for setting column's meta directly in the Table widget. Thanks!