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
4
votes
2 answers

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
  • 10,891
  • 7
  • 56
  • 52
4
votes
1 answer

How to draw or implement a pie chart using phpspreadsheet?

Well, I did not found any documentation for the graph chart except the API documentation which is cryptic for me, so if any of the PHPspreadsheet saw this please consider document this class. My question is how to draw a pie chart and implement it…
Mohammed Mahmoud
  • 59
  • 1
  • 3
  • 10
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
2 answers

PhpSpreadsheet Populate cells using a loop

I am using PHP library PhpSpreadsheet and would like to populate a spreadsheet (xlsx) using data from MySQL table using a loop to iterate through the cells and rows, something similar to this: .------------------------. |ID first_name last_name | |1…
odedta
  • 2,430
  • 4
  • 24
  • 51
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
  • 235
  • 1
  • 7
  • 16
4
votes
1 answer

How fix border in TcPDF writer in PhpSpreadsheet?

I've a PhpSpreadsheet process to export data to XLSX and PDF. I'm using TcPDF as PDF writer. But TcPDF has a problem to convert/translate border style. Xlsx export TcPDF export Any idea to fix this?
4
votes
4 answers

Change saving directory in phpspreadsheet

Im using PhpSpreadsheet to generate XLS files, all the functions work perfect except that it saves local files in temporary directories and I want to save them in a specific folder. use PhpOffice\PhpSpreadsheet\IOFactory; require __DIR__ .…
Javier Rincon
  • 41
  • 1
  • 1
  • 2
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
  • 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
  • 2
  • 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…
user4419336
3
votes
0 answers

Symfony 6 - Creating excel with PHPSpreadsheet and downloading it asynchronously

I'm stuck on something, and it seems internet haven't had this problem (or i haven't got the right keyword to find the answer) Keep in mind that I'm still learning Symfony 6 and I'm a bit by myself for now ... So I'm open if you tell me that…
3
votes
4 answers

Can't install the PHPSpreadsheet

I try to install the phpspreadysheet but these error occurs Installation failed, deleting ./composer.json. [RuntimeException] No composer.json present in the current directory (./composer.json), this may be the cause of the following…
Luhman Musa
  • 31
  • 1
  • 1
  • 2
3
votes
1 answer

PHPSpreadSheet | Saving XLSX unhides every row

$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet); header("Content-Type: application/vnd.ms-excel"); header("Content-Disposition: attachment;filename=$fileName"); header("Cache-Control:…
3
votes
1 answer

PHPSpreadsheet formula not working between dates

I want to calculate difference between 2 datetimes in hours with PHPSpreadsheet. This is how Excel does it: A1 and A2 cells format is: This is the result on web: When I change value through PHPSpreadsheet, I get #VALUE! and different value…
wast
  • 878
  • 9
  • 27
3
votes
2 answers

How to fetch the images present in the excel cell?

I need to read the images present in the cell, I know how to read the drawing present the sheet but the getDrawingCollection() only works on sheet. is there any function that will give the images present in the cell while getting the data. The below…
Bhagchandani
  • 548
  • 6
  • 21