PHP Library create Excel files by pattern?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
24 views
Hi,
Could you tell me the package for working with Excel templates,
There are a few Excel tables (invoice, invoice act-vipw works), that is, the files are not large. In fact, change only the values of some cells and to duplicate a string with the name of the goods. (1-5 lines)
Google is basically on PHPExcel which is DEPRECATED and now called PhpSpreadsheet. PhpSpreadsheet creates documents fine, but to take an Excel file to change the values cannot (if you are resaving and posleduyushim opened in Excel complains that not the right file extension or file corrupted), even copy-paste code examples from the documentation peresherstit damaged files that Excel cannot open.
Copy and paste the code from the docks PhpSpreadsheet
$spreadsheet = \\PhpOffice\\PhpSpreadsheet\\IOFactory::load('template.xlsx'); $worksheet = $spreadsheet->getActiveSheet(); $worksheet->getCell('A1')->setValue('John'); $worksheet->getCell('A2')->setValue('Smith'); $writer = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createWriter($spreadsheet, 'Xls'); $writer->save('write.xls');

It looks like one Excel file from multiple
5aeab6aabe38e319526224.png

Tried to save an html table as .xls, Excel complains but opens up but then printing from it is very difficult (table riding on a few villages and it is difficult to reconcile the size)
by | 24 views

1 Answer

0 like 0 dislike
I solved a similar problem using standard tools of Excel, namely the macro. Here is my article, however applicable to the Executive in the construction documentation, but the essence is the same: the template to fill in sample forms. Tiles are created in which data in filling out forms, and then the macro writes the data cell from the data sheet in a particular cell of the file. https://m.habr.com/post/344956/
Of the downsides of not solving the template file you will need to configure each printer, i.e. if you print on one set it and forget it, but if you need to print on the other, no one can guarantee that the layout previously saved files will not go. Solved migrating print template under a different printer and perevodom old files
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
35,647 users