Questions tagged [phpoffice]

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.

242 questions
0
votes
1 answer

PHPWord DOMDocument::loadXML(): Opening and ending tag mismatch: br line 1 and p in Entity, line: 1

What is the problem in my HTML why is it not accepted? Here is my HTML, I am using PHPWord to convert html to doc but I am getting the error below. PHPWord DOMDocument::loadXML(): Opening and ending tag mismatch: br line 1 and p in Entity, line:…
apelidoko
  • 782
  • 1
  • 7
  • 23
0
votes
0 answers

PHPWord - How to Convert HTML to Docx?

How do I convert this unclean html tag into word document? I am totally lost here, I don't know what I am doing, my goal is just to covert this html into word document, doesn't need to be fancy or accurate, I just want it to display the layout and…
apelidoko
  • 782
  • 1
  • 7
  • 23
0
votes
0 answers

Cant read xlsx file using PhpSpreadsheet

i want to read xlsx file and write back some data to the file like below : try { $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); $spreadsheet = $reader->load('CatagoryEng.xlsx'); dd($spreadsheet); } catch (\Exception $ex) { …
0
votes
1 answer

\PhpOffice\PhpWord issue converting HTML to DOCX

Thank you in advance i want to convert HTML into DOCX so i used \PhpOffice\PhpWord library in laravel The code for the same is as below $html = "

HELLO DEMO

"; $phpWord = new \PhpOffice\PhpWord\PhpWord(); $section =…
Ronak Solanki
  • 341
  • 2
  • 5
  • 14
0
votes
0 answers

Using the IF statement in PHPspreadsheet

I create an excel report in php using the phpspreadsheet library. But I ran into a problem: I need to use the "IF" operator in one column as in excel. $spreadsheet->getActiveSheet()->setCellValue("O{$row_number}", "=IF(A{$row_number}>10;1;0)") But…
MrJack0209
  • 51
  • 5
0
votes
1 answer

Style & content is missing in when create pptx from existing pptx using PHPPresentation

I am using this below code to load a pptx file & saving into a new pptx. My code is simple. But style is broken in new pptx file. can anyone kindly help ?
Rockers Niloy
  • 101
  • 2
  • 12
0
votes
1 answer

After reading and writing an excel file using phpSpreadSheet, the graph disappears

I'm trying to fill an excel file with data coming from a mysql server and using phpSpreadSheet. Then, I need to create a graph so users can see the graph already made. I can fill the excel file no problem, but the graph doesn't show up. So I decided…
Laurent
  • 188
  • 2
  • 13
0
votes
1 answer

Reading File With PhpSpreadsheet Sheet Out of Bounds Error

Trying to read from a XLSX file with PhpSpreadsheet however getting below error: PHP Fatal error: Uncaught PhpOffice\PhpSpreadsheet\Exception: Your requested sheet index: -1 is out of bounds. The actual number of sheets is 0. in…
harri
  • 494
  • 11
  • 26
0
votes
0 answers

Opening HTML as Word or PDF using PHP/Laravel

I'm a little confused about PHPWord w/ DomPDF. If I generate HTML using Laravel/PHP/Blade, store it in a text file saving it with .html extension, and open it with Word (open Word, select File open, etc), I see the page as I would like to see it in…
STP
  • 51
  • 8
0
votes
2 answers

PHPSpreadsheet download xlsx in browser

I want download my generate Xlsx file on my browser but when I execute this code, the request is launched without error but nothing happens header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); …
0
votes
0 answers

Cannot stub or mock class or interface "PhpOffice\PhpSpreadsheet\Worksheet\Worksheet"

I have a PhpUnit test class like this: use PHPUnit\Framework\TestCase; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; final class SheetValidationTest extends TestCase { private function isTitleValid(string $title) { $worksheetStub…
jasie
  • 2,192
  • 10
  • 39
  • 54
0
votes
1 answer

Why PhpSpreadSheet is not reading cell values?

I'm trying to read some cell values from a .xlsx file using PhpSpreadSheet, but I don't know why this isn't working. The file opens but when I read the values of the cell it returns nothing. I have checked that the filename is correct and that cells…
d1649356
  • 91
  • 1
  • 9
0
votes
1 answer

How to get specific columns in Laravel [Maatwebsite/Laravel-Excel]

the file i am importing has thousands of records which is causing my network to get slow. i want to read only those columns that i need, before inserting it into database. When file is processed , it should first search those columns not the whole…
Jo-ji
  • 17
  • 1
  • 6
0
votes
2 answers

All worksheets in spreadsheet appear to be a reference to sheet 0

I am writing a price import script which reads from an Excel spreadsheet. The spreadsheet is generated using Office 365 Excel however I am using LibreOffice Calc on Ubuntu 18.04 to view it during development - no issues here. I'm using…
mgldev
  • 101
  • 1
  • 4
0
votes
0 answers

PHPOffice and Read XLS in PHP

just a php beginner question. How can I create an input to load the XLS file without having to download it on the server and use it in the code below where I have the variable $inputFileName.