alhimik1986 / php-excel-templator

PHP Spreadsheet extension to the export excel file from excel template
MIT License
346 stars 69 forks source link

merge cells in two-dimensional arrays #12

Open lmax85 opened 5 years ago

lmax85 commented 5 years ago

Hi! Any solutions for use merged cells for two-dimensional arrays...?

'[[sales_amount_by_hours]]' = [ ['10000', '20000', '30000', '40000', '50000', '60000', '70000', '80000'], ]; template: image

result file: image

want this: image

thank you

duongsieu commented 4 years ago

I have a similar problem.

sukmaw commented 2 years ago

I have a similar problem.

alhimik1986 commented 2 years ago

It's not designed for template variables in merged cells because merged cells may have some ambiguity in implementation. That feature is better implement manually using the code. The cells with template variables should be unmerged (single). The values should insert like this: ['', '1000', '', '2000', '', '3000' ...]. And the merging of cells can be implemented by using callbacks '[[sales_amount_by_hours]]' => function(CallbackParam $param) { ... }