php-excel-templator
php-excel-templator copied to clipboard
Invalid cell coordinate A-1 at
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,
Hello. Please, leave the full code and xls-template file to easily reproduce the bug.
` 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.
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.
I have released the v1.0.14. I hope it will work.