Hi.
I'm trying to export a list to Excel, but I'm having issues on how the data format has to be to be displayed correctly in the sheet.
This is the dataSource I set:
array(
"dataSources" => array(
"data" => array(
"class" => '\koolreport\datasources\ArrayDataSource',
"dataFormat" => "associate",
"data" => $this->tableSettings['data']
)
)
);
The data is a simple associative array that I'm using in Table
to print in the browser and to export to PDF. But in the Excel sheet, the whole data is displayed in a single cell, like that:
ColumnA | ColumnB | Row 1 Cell 1 | Row 1 Cell 2 | Row 2 Cell 1 | Row 2 Cell 2
and so on....
I tried the following settings with no luck:
Columns:
array [
"code" => "code"
"name" => "name"
]
Data:
array:46 [
0 => array:2 [
"code" => "code"
"name" => "name"
]
1 => array:2 [
"code" => "062"
"name" => "AutoFill 4.7"
]
2 => array:2 [
"code" => "063"
"name" => "AutoFill 5"
]
3 => array:2 [
"code" => "032"
"name" => "Focus Test 1"
]
and so on...
]
I'm following this example but it is using a csv file as data source, not an array like I am. It seems that all other excel examples are similar, so I can't be sure how to achieve it.
Any advice or reference to help me on this problem? Thank you in advance.