php-excel-templator icon indicating copy to clipboard operation
php-excel-templator copied to clipboard

Invalid cell coordinate A-1 at

Open vaneatka opened this issue 2 years ago • 5 comments

Hi, I receive this error message when I try to render a template with multiple array type columns at once.. Error message: Invalid cell coordinate A-1 at [descriptions] [quantity] [cost]

example of payload. $array = [ {descriptions}: ['first','second','third], {quantity}: [1, 1, 1], {cost}: [0, 0, 0], ]

If in the template is left only one column it is rendered correctly.

It happens in PhpOffice\PhpSpreadsheet::adjustRowDimensions

using atm alhimik1986/php-excel-templator 1.0.11, phpoffice/phpspreadsheet : 1.22,

vaneatka avatar Mar 23 '22 11:03 vaneatka

Hello. Please, leave the full code and xls-template file to easily reproduce the bug.

alhimik1986 avatar Mar 23 '22 18:03 alhimik1986

` require 'vendor/autoload.php';

use alhimik1986\PhpExcelTemplator\PhpExcelTemplator;

$documentData = [ '[lineNumber]' => [ 1, 2, 3 ], '[descriptions]' => [ 'Description 1', 'Description 2', 'Description 3', ], '[price]' => [ 2, 3, 4 ], ];

$template = 'template/template.xlsx'; $outputPath = 'output/output.php';

PhpExcelTemplator::saveToFile( $template, $outputPath, $documentData ); ` The template content is this one. image

Repl link on it

vaneatka avatar Mar 25 '22 10:03 vaneatka

I couldn't reproduce the bug. Everything working well. At least it worked on my old code. I corrected the require_once('vendor/autoload.php'); to require( __DIR__ . '/../Bootstrap.php'); and the $outputPath = 'output.php'; to $outputPath = 'output.xlsx'; because the code just not launching.

Update: I have adapted my code for modern PhpSpreadsheet. Try to update the templator to latest version.

alhimik1986 avatar Mar 25 '22 19:03 alhimik1986

I've updated it in repl, Repl

Can you please recheck it there?

vaneatka avatar Mar 28 '22 14:03 vaneatka

I have released the v1.0.14. I hope it will work.

alhimik1986 avatar Apr 03 '22 15:04 alhimik1986