PHPOffice is an open-source collection of libraries used for reading and writing files in formats compatible with various "office" suites, such as Microsoft Office and OpenOffice.
Questions tagged [phpoffice]
242 questions
0
votes
1 answer
PHPWord - setting font inside Template Processor
I am using PHPWord to load a template file and create a new one from it.
$templateName = 'QuoteTemplate1.docx';
$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor($templateName);
$values = ['clientAddressName' => $quote->company_name];…

Jimmery
- 9,783
- 25
- 83
- 157
0
votes
0 answers
PHPSpreadsheet load CSV setting default data format
I am loading a CSV file via PhpOffice\PhpSpreadsheet\Reader\Csv. My 1st column contains a large number (15191100011) that I want loaded as the data format TEXT and not GENERAL. Because if it loaded as general it displays as 1.52E+10.
If you…

Chris Wolcott
- 302
- 1
- 3
- 9
0
votes
1 answer
Adding multiple images in excel using PhpSpreadsheet
This issue is solved with workaround. If I copy multiple images, using PhpSpreadsheet in excel, having same image name and different paths, than only last image is added multiple times. But if I rename images with different names, than it's working…

web2students.com
- 307
- 2
- 16
0
votes
1 answer
phpoffice/spreadsheet how can I add in a chart a value to each column
I am using PHPOffice/PhpSpreadsheet to produce a Chart in excel like this one:
But I can not set spreadsheet chart to display each column's value.
This is the code I have used:
$yaxis = new Axis();
$xaxis = new…

Iker Etxebarria
- 43
- 7
0
votes
1 answer
Yii2 update data by excel file long load time
I'm using Yii2 to create a tool to manage work load of my team. So everyday i need to import large amount of data (larger than 5k) to db using Excel and the loadtime usually take about 20-30 mins. Is there any way to improve the load time?
Please…

Starite SD
- 13
- 2
0
votes
3 answers
How to add styles to incoming HTML in PHPWord
In phpword, I see you used to be able to pass a styles array to the addHTML function, but not any more.
If my HTML doesn't have any inline styles set, is there a way to specify a fontStyle and paragraphStyle so it doesn't end up as plain 'Arial…

Nicolas Goosen
- 583
- 5
- 14
0
votes
2 answers
Cakephp: mpdf stores generated pdf in forbidden directory
In my Cakephp 3.6 application I am using mpdf to create pdf files. While on localhost is working without any problem, when I try it on the server I get this error :
SplFileInfo::isFile()…

thelaw
- 385
- 5
- 12
0
votes
1 answer
PHPWord - Class 'Footer' not found
I need to add a footer to the first page of my document:
require_once 'vendor\autoload.php';
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection(array(
'orientation' => 'portrait')
);
$footer =…

curtisnt
- 13
- 1
0
votes
0 answers
it is possible to do PERCENTILE.EXC in laravel? If yes how?
I am creating a program that generate report in excel.
And some of my problem is when generating excel I need a formula like Percentile
Percentile link: https://exceljet.net/excel-functions/excel-percentile.exc-function
I found a link of T-SQL that…

Mathew Magante
- 1,280
- 3
- 19
- 28
0
votes
1 answer
PHPWord - corrupted Word file
I want to download a word file from an existing template using PHPWord.
I tried this code but it generate corrupted file:
$file = ROOT . '/web/templates/recu.docx';
$PHPWord = new…

Sabra
- 177
- 2
- 19
0
votes
1 answer
Github - Download Not Fully Included All Folders/Files
I am new to Github. I downloaded the PHPWord (link below) on Github, but some how the folders: samples, tests, docs are missing. It only has the folder "src/PhpWord".
https://github.com/PHPOffice/PHPWord
I also use composer require…

Milacay
- 1,407
- 7
- 32
- 56
0
votes
0 answers
How to write data to an formatted & styled xls file with php (update data)
I have a formatted and styled xls file with dummy data on my server. I want to use this file as a base for all of my exports. I want to replace the dummy data with real one at the time of export with php.
I have read about phpoffice library, but I…

Vishal Suthar
- 25
- 8
0
votes
1 answer
How to get currency sign of cell-content using PhpSpreadsheet
I have cell content looks like "$ 1440" or "€ 970"
But on formula-field (after select cell) value looks like simple number "1440" or "970".
How can I get currency sign ($ or €) by using PhpSpreadsheet?
I tried code
$reader =…

Flam
- 21
- 2
0
votes
1 answer
PHPOffice spreadsheet to PDF export
I have some spreadsheets in MS excell. Trying to convert them to PDF by using PHPOffice and mPDF class. I have a problem to create and display footers on every created PDF page
This is working code for creating a PDF from spreadsheet.
$writer = new…

Nermin Resovic
- 1
- 2
0
votes
0 answers
How get row by index $sheet->getRowIterator()?
For example I need get only second row in current sheet without foreach.
foreach ( $sheet->getRowIterator() as $row) { ... }. How access to $sheet->getRowIterator() by index without foreach, or how start foreach from another position, not from…

Andrew
- 1
- 1
- 1