avadim483 / fast-excel-templator Goto Github PK
View Code? Open in Web Editor NEWLightweight and very fast Excel Spreadsheet generator from XLSX-templates in PHP
License: MIT License
Lightweight and very fast Excel Spreadsheet generator from XLSX-templates in PHP
License: MIT License
I am attempting to fill out an Excel form using the templator. However, whenever I attempt to save the file (even without doing any editing, the fatal error below will still show up).
[14-Mar-2024 07:04:21 UTC] PHP Fatal error: Uncaught avadim\FastExcelWriter\Exceptions\Exception: File "/var/www/html/wordpress/wp-content/plugins/judges-form-auto-generate/files/tmp/output.xlsx" already exists in /var/www/html/wordpress/wp-content/plugins/judges-form-auto-generate/lib/composer/vendor/avadim/fast-excel-writer/src/FastExcelWriter/Exceptions/Exception.php:20
Stack trace:
#0 /var/www/html/wordpress/wp-content/plugins/judges-form-auto-generate/lib/composer/vendor/avadim/fast-excel-writer/src/FastExcelWriter/Writer.php(350): avadim\FastExcelWriter\Exceptions\Exception::throwNew()
#1 /var/www/html/wordpress/wp-content/plugins/judges-form-auto-generate/lib/composer/vendor/avadim/fast-excel-writer/src/FastExcelWriter/Excel.php(203): avadim\FastExcelWriter\Writer->saveToFile()
#2 [internal function]: avadim\FastExcelWriter\Excel->__destruct()
#3 {main}
thrown in /var/www/html/wordpress/wp-content/plugins/judges-form-auto-generate/lib/composer/vendor/avadim/fast-excel-writer/src/FastExcelWriter/Exceptions/Exception.php on line 20
I noticed that the file is still written when using the template() function. Maybe that is why the Writer is not liking it.
when I use:
require 'FastExcelReader/autoload.php';
use \avadim\FastExcelReader\Excel as ExcelReader;
require 'FastExcelWriter/autoload.php';
use \avadim\FastExcelWriter\Excel as ExcelWriter;
require 'FastExcelTemplator/autoload.php';
use \avadim\FastExcelTemplator\Excel as ExcelTemplator;
$excel = ExcelTemplator::template('./test/file1.xlsx', './test/file2.xlsx');
I get:
Declaration of avadim\FastExcelTemplator\Excel::createSheet(string $sheetName, $sheetId, $file, $path, $excel): avadim\FastExcelTemplator\Sheet must be compatible with avadim\FastExcelReader\Excel::createSheet(string $sheetName, $sheetId, $file, $path): avadim\FastExcelReader\Sheet
How to solve?
I have been given a xlsx template to populate with lots of cells with fixed drop downs (shared strings?) - like 'Yes' and 'No'... It is possible to set these properly using templator? Excel seems to set them as "shared string" (?) integer values, but templator just replaces these with a string value. I can find the values of the shared strings.
If I get the row template:
$rowTemplate = $sheet->getRowTemplate(3);
dpm($rowTemplate);
I get the following definition for the cell:
I'm working with an Excel (.xlsx) template file that contains charts and formulas. I'm using the Template package to populate the template with data. However, I'm encountering an issue where the data is being updated correctly, but the cells where formulas are left blank. There should be calculated data in them.
Specifically, in the row, the formula cells are being represented like this:
[
'E' => [
'v' => (formula is here, not data, should be data),
'f' => (formula is here)
]
]
Additionally, the charts in the file are not loading correctly because the formulas haven't been executed and haven't retrieved data from other sheets.
To resolve this, I need to find a way to trigger the formulas to run before I download the updated file. How can I ensure the formulas are properly evaluated in the output file?
In my Excel template I use the print area set, and it doesn't work when outputting a new file and there are also several records that have the wrong cell format as in the example in the following image
and how to sum formula with dynamic cells?
source code
https://pastecode.io/s/zv4r09be
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.