Questions tagged [phpoffice-phpspreadsheet]

70 questions
9
votes
1 answer

Corrupted composer.json file in Laravel 8

When I tried to remove the package maatwebsite/excel from my project, I damaged something badly. The problem is that I can't track the changes I made. Before I removed maatwebsite/excel from composer.json, I removed phpoffice/phpspreadsheet probably…
5
votes
2 answers

installing maatwebsite/excel with laravel 9 but getting the phpoffice/phpspreadsheet errors

installing maatwebsite/excel with Laravel 9 but getting phpoffice and PHP version issues. I am using PHP 8.1, I downgrade to PHP 8.0 but still doesn't work. Even I enable the gd extention from the php.ini file. I am installing maatwebsite using…
3
votes
0 answers

PhpSpreadsheet Fatal Error "Could not find zip member"

Hi am using PhpSpreadsheet, and here is my code: switch ($file_extension) { case 'xlsx': $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); break; case 'xls': $reader = new…
VIKESIR
  • 225
  • 2
  • 9
3
votes
1 answer

We found a problem with some content in 'Spreadsheet.xlsx'. Do you want us to try to recover as much as we can?

I have the following basic PHP project (just one file plus composer config): composer.json { "config": { "optimize-autoloader": true, "platform": { "php": "7.4.9" } }, "require": { …
Viewsonic
  • 827
  • 2
  • 15
  • 34
3
votes
0 answers

Excel validation in Laravel

I'm trying to do some Excel validation when uploading a file. This is what my Excel file looks like. Name | Price 1 | Price 2 | Price 3 | Total Item 1 | 123 | 123 | 123 | 369 Item 2 | 1200 | 300 | 900 | 2400 I need to make…
2
votes
0 answers

PHPSpreadsheet setAutoSize function not working as expected

I am using PHPSpreadsheet and I'm doing the following to autosize the relevant columns: foreach (range('A', 'K') as $col) { $productsSheet->getColumnDimension($col)->setAutoSize(true); } The issue is, however, that extra padding is added. The…
2
votes
1 answer

Fill cell with text if empty in PHPSpreadSheet

I want to make something like a placeholder for an empty cell, so I decided to use conditional formatting, example here says about OPERATOR_LESSTHAN, but nothing much about other conditions. I want to fill cell with colored text, which says…
2
votes
0 answers

PHPOffice PHPSpreadsheet corrupted excel file

Working with PHPSpreadsheet to create a customized spreadsheet. We have two servers. On the first with ubuntu+apache all works fine . However, with the same code on the second server (centos+nginx) we have corrupted file. Code…
1
vote
1 answer

Convert PHP Spreadsheet generated Multidimensional Array to Associative Array using first row as columns names(key)

I am working with php spreadsheet library and was able to get the multi dimensional array of sheet data. but now I want to convert this array to an associative array by using first row of sheet as keys. $arr_upsfile = explode('.',…
1
vote
1 answer

PhpSpreadsheet - XLSX - Read charts in order

I'm using library PHPOffice/PhpSpreadsheet to read charts. Right now it seems that reading charts is in the order of pasted charts (doesn't matter if the later added chart is above previous charts). I'd like to find way to mapping charts in correct…
Matteor
  • 11
  • 1
1
vote
2 answers

Error while exporting Excel using PHP Spreadsheet and CodeIgniter 3 in PHP 8.2

I'm facing an issue while exporting Excel using PHP Spreadsheet and CodeIgniter 3 in PHP 8.2. The error message is shown in the following image: Here is the code snippet that I'm using: $fileName = 'activityReport.xlsx'; …
1
vote
1 answer

Not able to read file with live data which is a calculation from another application (DDE function)

I'm trying to read an XLS file. Data of which is being updated by an external application through a formula (DDE function). So, the file is getting updated every second. When I try to read the file, I'm getting the below…
ishan shah
  • 455
  • 2
  • 8
  • 23
1
vote
1 answer

Phpspreadsheet cells are not being formatted as specified

I'm trying to set a format other than "General" on cells, but they remain as "General". This is a simplification of my code: use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\IOFactory; use…
Luis Martin
  • 910
  • 3
  • 14
  • 31
1
vote
0 answers

PhpSpreadsheet: two table in a sheet and two autofilter

i am using phpspreadsheet. I have two tables in the same spreadsheet and in both tables I would like to add the autofilter, but it takes into account only the last one added. Example: //table 1 code ... ... //autofilter…
Spino
  • 9
  • 2
1
vote
0 answers

Excel formula deletion using php Laravel

I want to modify an already existing excel sheet with delete the formula without affecting the values in the cell which are generated by those formula used in the sheets using PHP. I tried to use php Spreadsheet. Not able to delete the formula used…
1
2 3 4 5