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
1
vote
3 answers
PhpOffice\PhpWord - TemplateProcessor add List
I'm using using PhpOffice library. Is there any option how to replace Variable in docx file with ordered list?
With templateProcessor method setComplexValue I can add text with code
$title = new…

Duracell
- 11
- 1
- 3
1
vote
0 answers
phpWord add chart to location specified by a variable on a template
I'm trying to insert a chart into an existing .docx file, somewhere in the middle of the file.
There are other sections where I had to insert numbers generated by my code which I just did using the ${variable} method and using…

movac
- 1,576
- 3
- 21
- 45
1
vote
1 answer
Add Line numbering on a Docx in PHP
I work on docx uploaded by users and I want to add line numbering (like this: http://prntscr.com/n5rc1s) on the docx before exporting it in PDF.
I tried to add this with PhpOffice but I did not succeed.
My code can convert in PDF but without line…

Aymeric Maitre
- 11
- 3
1
vote
1 answer
Create Dataset/Array for VLOOKUP Using PHPSpreadsheet
I have a export.php file with a goal of setting data validation with a VLOOKUP function off of that. However, it seems I can't find anything in the Recipes that actually seem to support this. I thought I found something but it doesn't seem to work,…

treyBake
- 6,440
- 6
- 26
- 57
1
vote
0 answers
PHPPresentation lose styling when we copy from particular path and saving new pptx
I have search around google regarding PHPPresentation but nothing found. I know this type of question already asked (PHPOffice PHPPresentation lose original styling on saving pptx) and i have checked the answer of this particular question…

kunal
- 4,122
- 12
- 40
- 75
1
vote
2 answers
Laravel Excel Export - From View not working
I tried to implement exporting to excel file From View approach using the Laravel Excel. Here is the link of the documentation https://laravel-excel.maatwebsite.nl/3.1/exports/from-view.html. But I can't figure it out yet referencing the example…

Eli
- 1,256
- 4
- 29
- 59
1
vote
0 answers
Composer require phpoffice/phpexcel not installing
Basically I'm trying to execute;
composer require phpoffice/phpexcel
And I get;
Using version ^1.8 for phpoffice/phpexcel
./composer.json has been updated
[Symfony\Component\Debug\Exception\FatalThrowableError]
…

davidelias16
- 91
- 1
- 10
1
vote
1 answer
How to set excel cell time format in PhpSpreadsheet
How to set excel cell time format in PhpSpreadsheet?
=> I have set perticular time format in cell. but, i coudn't find.
Note: check my screenshot for more details

Bharat Chauhan
- 3,204
- 5
- 39
- 52
1
vote
1 answer
PHPOffice\Excel Styling Worksheet without a Spreadsheet Object
I'm having trouble styling cells in a worksheet object that doesn't yet belong to a spreadsheet object. Is this possible? It doesn't appear to be possible using the getStyle() method since this method calls functions in the parent spreadsheet. Maybe…

flint
- 345
- 5
- 15
1
vote
1 answer
PHPSpreadsheet and writing large numbers of decimal places
I'm having difficulty with PHPSpreadsheet when creating an XLSX file and attempting to write large numbers of decimal places to numerical values.
PHPSpreadsheet is rounding my 14 decimal place numbers, but I need them stored exactly as…

JamesG
- 1,687
- 2
- 25
- 39
1
vote
1 answer
How to get all sheet names without trimming?
I have excel file with sheet names utf-8, and I got trimmed sheet name because this sheet title is more then 31 characters.
My code:

Mowshon
- 939
- 9
- 16
1
vote
0 answers
issue when saving rtf file (phpword lib)
I have some issue when i saving RTF file with phpword lib.
I open an RTF file with IOFactory::load, then i save it with function write and I have some metadata on the file i don't know why.
Here is my code:

necroma
- 11
- 2
1
vote
0 answers
PHPWord code not working to edit template and save as new file
I’m working on a page that keeps record of all the data and documents of employees in a company, part of its function is generating ID cards, which is the part i’m struggling with.
I downloaded the PHP Word by first installing the composer and using…

ChBgt909
- 23
- 6
1
vote
2 answers
How get grouping rows in PHP from EXCEL?
How get grouping rows in PHP from EXCEL?
This code does not issue a groups:
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
$reader->setReadDataOnly(TRUE);
$spreadsheet = $reader->load("bulat_price.xlsx");
$worksheet =…

Stanislav
- 21
- 1
- 5
1
vote
0 answers
PHPWord Reading more than docx from database to generate new docx
I'm trying to read 2 docx files or more from database and write all of it in new docx and may add text after
but it only read one file and don't even read the text below the loop
i'm new to php and phpword
i'm using netbean IDE 8.0.2
this is my…

Somaya Momtaz
- 11
- 3