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.
670
questions
-1
votes
0answers
18 views
phpspreadsheet and codeignater 4 promlem
I need to set format to cell, i'm using phpspreadsheet library and in documentation i found this code:
// Get the current date/time and convert to an Excel date/time
$dateTimeNow = time();
$...
0
votes
0answers
7 views
Extract images or charts from XLSX with PHP?
I have been trying to extract images and charts from an Xlsx file using the phpspreadsheet libray; I have however been unsuccessful.
Indeed, the piece of code I wrote is unable to find any image or ...
0
votes
0answers
23 views
Installing PHPOffice/PHPSpreadsheet and PHPOffice/PHPWord using composer
I have successfully installed PHPSpreadsheet and would like to install PHPWord as well but there seems to be no documentation on this and I'm afraid that composer will just write over any files that ...
0
votes
0answers
12 views
How can I add gap between bars using phpspreadsheet
Say, I have two set of data (x,y). I want to add gap between two bars in data series. Here is my code taken from phpspreadsheet sample.
$worksheet = $spreadsheet->getActiveSheet();
$worksheet->...
0
votes
0answers
11 views
Phpspreadsheet Comment box text Horizontal Right
How could i set column comment text align to right? here is my code:
$spreadsheet->getActiveSheet()
->getComment('E11')
->setAuthor('Mark Baker');
$commentRichText = $spreadsheet->...
1
vote
0answers
21 views
Link an image to a cell with phpspreedsheet
I am using code this code to add images in column and cell.
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($img);
imagecopyresampled($image_p, $image, 0, 0 , 0 , 0, $...
-1
votes
1answer
53 views
Error installation phpoffice/phpspreadsheet with composer
I try to install a specific spreachsheet lib with this command:
composer require phpoffice/phpspreadsheet:1.8.2 (because I have Php5 version)
I have this error :
Your requirements could not be ...
0
votes
1answer
29 views
phpspreadsheet : getCalculatedValue don't get the calculated value
I'm using the library phpspreadsheet, and I have a problem on one of my cell.
In my excel I got :
C
D
8
12% (calculated by excel with complicated formula)
12% (formula : =C8)
The cell D8 value is &...
0
votes
1answer
29 views
How do you read a file with formulas in phpspreadsheet?
I have the following code:
$Reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$Reader->setReadDataOnly( true );
try {
$spreadSheet = $Reader->load( $file );
} catch (\Exception $e) {
...
1
vote
1answer
19 views
Laravel Debugbar Affecting Excel Download
So I installed Laravel Debugbar today in an attempt to make my local dev a better experience, and for the most part, it has. An issue has arisen though when I try to download an Excel generated from ...
0
votes
0answers
13 views
How to show PhpSpreadsheet footer chart and set PrintArea in PDF
Hello all I have an excellent Excel output from phpspreadsheet. I would however want it in pdf but the footer isn't appearing and I can't as well export only the set PrintArea.
here's the code I'm ...
0
votes
0answers
37 views
How to use PhpSpreadsheet in cakephp2
I Tried Many Thing To Implement PhpSpreadsheet in CakePHP 2.x , In CakePHP 4 It Worked For Me.
Finally I Tried things mentioned in given link blog
http://abakalidis.blogspot.com/2018/08/how-to-use-...
0
votes
0answers
26 views
Laravel Excel import file with images
I'm using maatwebsite/excel package for laravel excel, I have used it before for importing & exporting and it worked fine, but now I need to import a file with images in cells.
When I call the row ...
0
votes
0answers
26 views
How insert text and image together for loop
How can I insert text and image like screenshot. when I'm inserting images to Cell, they are overlapping. I want text will add on top center and image will be below text.
My code below:
use PhpOffice\...
0
votes
0answers
28 views
Docker compose with PhpSpreadsheet
How can I create a docker-compose with PhpSpreadsheet?
I created a docker-compose file with WordPress, Mysql and Adminer. I'm creating a plugin that will import WooCommerce products from an excel (....
0
votes
0answers
22 views
Setting Cell Background Color in PHP Spreadsheet
I'm trying to set the background color of a cell with a conditional. I've got it close, but it's setting Pattern Color and not Background Color
$conditional = new Conditional();
$conditional->...
0
votes
0answers
33 views
Could not find package phpoffice/phpspreadsheet
[InvalidArgumentException]
Could not find package phpspreadsheet.
Did you mean one of these?
portphp/spreadsheet
phpoffice/phpspreadsheet
ideea/excel
phpoffice/phpexcel
...
0
votes
0answers
32 views
reading excels files with password using PHPSpreadsheet
I'm reading Excel files with PHPSpreadsheet and all its ok, but I am having problems with files that have a password. I know the password of the files but I don't how to read it or where I need to put ...
0
votes
0answers
14 views
SUMIFS corrupting spreadsheets with PHPSpreadsheet
I am using PHPSpreadsheet and am reading in a spreadsheet with the following (working correctly) formula. I'm using Libre Office to generate my spreadsheet.
=SUMIFS($My_sheet.C:C,$My_sheet.B:B,"&...
0
votes
0answers
11 views
Is there a way to make dynamic chart in phpspreadsheet?
I'm need to make a dynamic chart with phppreadsheet with filter and grouping fields as you can do easyly in Excel:
dynamic chart
But I only found how to make static charts.
Is there a way to make this?...
0
votes
0answers
28 views
Uncaught Error: Call to a member function attributes() on null : PHP SpreadSheet
I have data's on my excel file. But on my case 1st 5 lines are empty and then the data's are starting.
My Code is not reading this case. But if i remove the 1st 5 lines manually the code starts ...
1
vote
0answers
15 views
I can't get a file-location popup for saving phpspreadsheet file to local disk
The user should be able to save a generated excel sheet to a local location of his choice.
This is the javascript code to open the php file that generates the excel file.
<script>
...
0
votes
1answer
49 views
Convert Excel file to array while preseerving formatting when using PHPSpreadsheet
Whatever I do, my array does not keep cell value formatting when I convert data to array.
How to convert formatting to HTML preferably?
<?php
namespace App\Service;
use PhpOffice\PhpSpreadsheet\...
0
votes
0answers
28 views
How to get all columns inside one Row by phpSpreadsheet?
I have two rows
A B
one user
two employee
three worker
I want all the columns of the 'A' row. is it possible in PHP spreadsheet?
here is my code
$...
0
votes
1answer
18 views
How to create multiple choice drop down phpspreadsheet
I want create multi choice drop down in phpspreadsheet but i don't found how to make it.
$spreadsheet->getActiveSheet()->setDataValidation(
'P2:P100',
(new DataValidation(...
0
votes
0answers
32 views
PhpOffice\PhpSpreadsheet getvalue retrive incorrect value on centos7 server
I've problem when retrieving values from *.xlsx file.
I've tested all project on a dev machine with Windows 10 and xampp (with PHP 7.4) and everything works fine.
On public server (vps plesk with ...
0
votes
1answer
39 views
Get calculated height of a PHPSpreadsheet row
I'm trying to get the calculated height of a row in PHPSpreadsheet but whenever I do something like
$spreadsheet->getActiveSheet()->getRowDimension($row)->getRowHeight();
I always get a -1 ...
1
vote
1answer
671 views
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-...
0
votes
0answers
99 views
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');
...
0
votes
1answer
14 views
How to evaluate a CSE formula using PhpSpreadsheet?
I'm using PhpSpreadsheet (1.15.0) to generate a XLSX document with formulas.
One of this formula is a Ctrl+Shift+Enter (CSE) formula.
When generating a document and then opening it, simple formulas (...
1
vote
0answers
40 views
PHP Spreadsheet Laravel Dropdown allowing only 255 characters ,How to exceed Character limit?
Im using PHP Spreadsheet in Laravel and i need to show list of states in dropdown,Im not able to show states once 255 character limit is passed ,I searched in Stackoverflow but every answer is not ...
0
votes
1answer
51 views
PHPSpreadsheet: getHighestDataRow/getHighestDataColumn after fromArray
I'm using fromArray to load an array of data into a worksheet. This is working fine. After doing so, getHighestDataColumn and getHighestDataRow do not seem to be updated. Is there a way to force ...
0
votes
0answers
33 views
How to extract shapes with PhpSpreadsheet
How do I extract shapes from an Excel file with PHPOffice/PhpSpreadsheet?
I tried using the getDrawingCollection function but it does not extract the shapes.
1
vote
0answers
33 views
PhpSpreadheet BaseWriter not found in PhpSpreadsheet/Writer/Xlsx,php:32
I was using phpexcel on an old site (that doesn't even have composer), but i got stuck in this error.
Fatal error: Uncaught Error: Class 'PhpOffice\PhpSpreadsheet\Writer\BaseWriter' not found in /cpl/...
0
votes
0answers
35 views
skipping the Named formula failure
Hi I'm using maatwebsite/excel Library and want to disable calculation / resolution of named formulas when importing the Excel file. because it throws an error and the process stops, while File has a ...
0
votes
0answers
23 views
I am not able to get a cell background from a .xlsx using phpspreadsheet and conditionals
So this is my problem: I am working with a .xlsx file which contains a very simple table and its background is displayed using conditionals:
excel table capture
Now I am trying to get that background ...
0
votes
0answers
39 views
Find and replace in phpspreadsheet
I need help on how to Find and Replace in Excel worksheet using PHPSpreadsheet.
While going through the documents I found this API :
https://phpoffice.github.io/PhpSpreadsheet/classes/PhpOffice-...
2
votes
0answers
84 views
Named formula issue when uploading Excel in Laravel
I'm using "maatwebsite/excel": "^3.1" library and importing file WithCalculatedFormulas trait, but I'm getting the error: "You must specify a formula value for a named formula&...
1
vote
0answers
36 views
PhpSpreadsheet outputs encrypted text instead of starting the download
I'm creating an API with slimframework and I have a route where I'm trying to export data to an excel file and download it instead of saving it but when I try to do it it outputs text like this ��ࡱ�;�,...
0
votes
0answers
31 views
How to fixed the initial value of the y axis of the chart
When the dimension of the first bar(of the grouped) exceeds a certain threshold, which in this example is 25, the y-axis instead of starting from the value 0 starts from an arbitrary value, which in ...
0
votes
0answers
26 views
How to read all cells from certain columns on an Excel spreadsheet with PHP?
I have an Excel spreadsheet like this:
The following code:
<?php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$reader = new ...
0
votes
1answer
51 views
Formule with reference to another workbook
I have two files:
File1.xls with data in column F36 -> 1000.00
Empty file File2.xls
I'm trying to reference file1 inside file2 -> A1. Meaning I will have the value of [File1.xls]F36 in [File2....
0
votes
1answer
97 views
Attempted to load class “Spreadsheet” from namespace “PhpOffice\PhpSpreadsheet” - Symnfony4
I have already imported PhpSpreadSheet in my controller.
I do this for calling the lib :
The libs is present in my vendor folder.
(PHP 7.3)
Why I have the error below ??
"Attempted to load ...
0
votes
2answers
30 views
Calculation not working after save file phpspreadseet
Strange...I only replace some value in a template xlsx with setCellValue(), I save the file and when I open it in Excel 2013 or Libre Office calc, the calculation are not done.. But it's ok in Excel ...
0
votes
1answer
28 views
PHP Spreadsheet: After saving data to a new worksheet, the data of the previous worksheets are deleted
I am creating a script to save CSV data into an excel document, but in different worksheets, I mean, every CSV doc will go into a new worksheet, but after saving data to a new worksheet the previous ...
0
votes
0answers
40 views
Some issue With PHP SpreadhSheet and Chart Sheet
Software version used
PHP 7.3.12
Symfony 4.4
PHP Spreadsheet 1.14 -> 1.15 (updated but no changes)
Hi erverybody !
I have some issues with using PHP SpreadSheet
I have an excel template with two ...
0
votes
1answer
186 views
How do you read cells in PhpOffice\PhpSpreadsheet using the IReadFilter in PHP?
I am trying to read two columns from a spreadsheet across multiple sheets. An example of this would be:
Sheet One: Sheet Two: Sheet Three: ETC...
A ..... V A ..... V ...
0
votes
0answers
23 views
How to fetch a value from a spreadsheet and add it with user input using PHP?
Using PHP,I would like get value dynamically from html form and add that value to the existing value at cell C3 in my spreadsheet.The below code wasn't working.PL help to solve it.
HTML:-<input ...
0
votes
0answers
18 views
Writing Date into a field with conditional formatting leads to left alignment
I have a problem with the PhpSpreadsheet. Could you help me, please?!
I have to write data into an Excel-file (*.xlsx). Two colums have conditional formatting, like changing the background-color to ...
0
votes
0answers
24 views
PHPSpreadsheet 1.15.0, access cell by name
I have an Excel "Template" with some named cells as "student" for example, which is the cell coordinates B2
I used to use PHPSpreadsheet and access some cells by: $worksheet->...