Questions tagged [phpspreadsheet]

PhpSpreadsheet is a library written in pure PHP and providing a set of classes that allow you to read from and to write to different spreadsheet file formats, like Excel and LibreOffice Calc.

See:

859 questions
9
votes
2 answers

Open XLSX file that protected by a password with PHPSpreadsheet

I'm trying to open an Excel file (.xlsx) that is protected by a password with PHPSpreadsheet (documentation). I know the password but I don't find a way to open it. The load()method of \PhpOffice\PhpSpreadsheet\Reader\Xlsx doesn't give the…
B 7
  • 670
  • 7
  • 23
9
votes
2 answers

Dynamic Cell Merging in phpspreadsheet

My question is about generating an Excel sheet in codeigniter. The excel sheet sub-headings are not fixed, they are as per data, that's why i am not able to merge cells. Is there any solution for that? Ex:-Here sub-headings are not fix.
Abhilash Sharma
  • 103
  • 1
  • 2
  • 8
8
votes
3 answers

how to use excel sum formula in php phpspreadsheet?

I am using PhpSpreasdheet php library. I have done almost everything i want to sum the particular column and want to show total of that column.. See My output is coming below:- My expected output like below:- I have tried below code:- $spreadsheet…
kunal
  • 4,122
  • 12
  • 40
  • 75
8
votes
3 answers

PhpSpreadsheet: Permissions | ZipArchive::close(): Failure to create temporary file

I would like to offer an Excel-File for download with PhpSpreadsheet Here is my code: require 'vendor/autoload.php'; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; $spreadsheet = new…
Phantom
  • 638
  • 1
  • 7
  • 18
8
votes
2 answers

Class 'PhpOffice\PhpSpreadsheet\Spreadsheet' not found

I have used Composer to install phpoffice/phpspreadsheet. It was installed in a base 'vendor' directory. However where I am needing to use it is in a subdomain directory. I manually moved it to a different 'vendor' directory. a bit deeper…
Scott Johnson
  • 107
  • 1
  • 1
  • 5
7
votes
2 answers

Fatal error: Uncaught PhpOffice\PhpSpreadsheet\Reader\Exception: Could not find zip member

I have installed the latest version of this library using Composer. I created a test file to test the library's functionality, but when I try to parse a file and make a data array out of it, I get this error; Fatal error: Uncaught…
Ivan Savin
  • 71
  • 1
  • 1
  • 2
7
votes
0 answers

Read Xlsx file from a string

I have an Xlsx file content in a string, loaded from the database. Currently, I create the spreadsheet using a temp file: file_put_contents($fileName, $bundle['package_blank']); $wobook =…
Marcodor
  • 4,578
  • 1
  • 20
  • 24
6
votes
5 answers

PhpOffice\PhpSpreadsheet\Reader\Exception Failed to load .... as a DOM document

When I try to export datas as excel file on the specific request I got below error PhpOffice\PhpSpreadsheet\Reader\Exception Failed to load path_to_project\storage\framework\laravel-excel\laravel-excel-pz23rYwVENIOZUw7vnvhKaNjUkkNLNT8.html as a DOM…
Vpa
  • 703
  • 2
  • 9
  • 30
6
votes
1 answer

Creating excel file and then send as attachment using phpmailer

I have gone through multiple documents for this question and have applied those steps but so far in vain. I have written a code for excel file but I want to get its contents in the same file and use them as an attachment of excel file using…
Dev
  • 111
  • 1
  • 13
6
votes
3 answers

PhpSpreadSheet Class ZipArchive not found Error

I've just downloaded PhpSpreadsheet package via composer and I tried to generate an Excel spreadsheet. But all I get is an error "Class ZipArchive not found ". I work on Windows. In my localhost it is correctly generating excel. My localhost php…
Ambili Bijesh
  • 69
  • 1
  • 2
6
votes
2 answers

PHPOffice/PhpSpreadsheet get cell column index as integer

How can I get cell column index as integer? I have searched the documentation but I didn't found anything.
user08
  • 695
  • 3
  • 8
  • 25
6
votes
1 answer

Not able to create multiple worksheet in PHP Excel

Hi I am creating multiple worksheet in PHP Excel but it is not working. I am facing one issue "You tried to set a sheet active by the out of bounds index: 1. The actual number of sheets is 1." Here is my code: function…
Shivam
  • 702
  • 2
  • 10
  • 25
5
votes
1 answer

How to protect individual cell using phpspreadsheet

I want to protect particular cell content from being amended. When I tried to protect whole sheet, no problem. $sheet->getProtection()->setSheet(true)->setDeleteRows(true); But, could not set protection for individual cell. I tried the following…
Premlatha
  • 1,676
  • 2
  • 20
  • 40
5
votes
1 answer

phpoffice/phpspreadsheet - How to exclude no value cells from getHighestRow()

$eanStyle = new \PHPExcel_Style(); $eanStyle->getNumberFormat()->applyFromArray([ 'code' => '0000000000000' ]); /* apply styles */ $mainSheet->duplicateStyle($eanStyle, 'A2:A10000'); Code above generates .xlsx template file, user enters data…
Maytyn
  • 122
  • 1
  • 10
5
votes
0 answers

Writing excel file very slow using PhpSpreadSheet

I am using PhpSpreahSheet to read multiple Excel file and merge them in one file. I read my files with this code : $readerData = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); $spreadData = $readerData->load("File/file1.xlsx"); $readerData = new…
Toto D
  • 109
  • 2
  • 12
1 2
3
57 58