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:

702 questions
5
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.
Jona
  • 525
  • 1
  • 6
  • 17
5
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
  • 2,043
  • 15
  • 20
5
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
  • 55
  • 1
  • 1
  • 5
5
votes
1 answer

PHPSpreadsheet - Where is "PHPExcel_Worksheet_Drawing"

I am really mad at PHPSpreadsheet, and why the functions are not named as in PHPExcel, or why in documentation doesn't mention something about "PHPExcel_Worksheet_Drawing", where can I find it in PHPSpreadsheet?. In PHPExcel I have this: $objDrawing…
Máxima Alekz
  • 438
  • 7
  • 21
4
votes
0 answers

getFormattedValue give wrongly formatted cell value

I'm trying to get value from a cell using getFormattedValue, in the cell it is showing as 22 5/8 and the value I'm getting from getFormattedValue is 23\ ?/8 If I use getCalculatedValue I'm getting the value 22.64 How I can fix this issue?
Unnikrishnan
  • 1,808
  • 4
  • 18
  • 30
4
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
  • 3,510
  • 7
  • 28
  • 65
4
votes
1 answer

Creating a CSV File from a string using PhpSpreadsheet

Is this possible? or must one use a PHP library such as thephpleague/csv? Example, according to PhpSpreadsheet's documentation: $reader = new \PhpOffice\PhpSpreadsheet\Reader\Csv(); $spreadsheet = $reader->load($file); $writer = new…
tfont
  • 9,576
  • 4
  • 48
  • 51
4
votes
1 answer

PHPSpreadsheet cannot set worksheet margin

Hi I have a little problem with this plugin, this is the code that makes an error Sheet::macro('setPageMargins', function (Sheet $sheet, float $top = 1, float $right = 0.75, float $bottom = 1, float $left = 0.75) { …
4
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
  • 112
  • 10
4
votes
1 answer

Populating a mysql database with an excel file using phpspreadsheet

I am trying to populate a mysql database with an excel file using phpspreadsheet library. I am doing it in the following way but I get just the first row. How can I do it for all the rows $spreadsheet =…
Unah Henry
  • 177
  • 5
  • 13
4
votes
1 answer

Is it possible to write in an existing spreadSheet with PhpSpreadSheet?

I'm currently using PhpSpreadSheet Library and I wanna write into an existing spreadSheet. Is that possible? If yes, how? I didn't see any possibility in the documentation. Thanks!
4
votes
3 answers

Class 'ZipArchive' not found

What I want to realize I will use PhpSpreadsheet in a PHP web application development, I am trying to configure PHP Zip extension necessary for PhpSpreadsheet to be enabled on the server. I tried two methods, but I could not set it well, so I would…
ta96
  • 41
  • 1
  • 4
4
votes
1 answer

PhpSpreadsheet chunk filter read returning empty rows

I'm trying to read an XLSX file by chunks. But some of the chunks are empty on the var_dump out put. I'm using PHP7.2 and Laravel 5.5 framework. That is what I've tried so far: Filter class ChunkReadFilter implements IReadFilter { private $startRow…
web.learner
  • 101
  • 1
  • 8
4
votes
1 answer

PHPSpreadsheet auto row height not works with LibreOffice latest version

I am using PHPSpreadsheet now, I am trying to get rows to auto height. It is working fine in MSOffice But Not work in LibreOffice. Question How to make the row auto height work in LibreOffice latest version. Works fine in…
Mr. ED
  • 11,163
  • 10
  • 51
  • 114
4
votes
1 answer

PhpSpreadsheet is corrupting files

I am using PhpSpreadsheet to modify an existing file and send it to the browser, but every time I download the file excel gives me the following error: We found a problem with some content in filename.xlsx. Do you want us to try and recover as much…
alex_6169
  • 75
  • 1
  • 5
1 2
3
46 47