by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
komahui
@komahui
How to solve the problem of slow exporting dozens of worksheets
please help me,thanks
Adrien Crivelli
@PowerKiKi
image.png
Adrien Crivelli
@PowerKiKi

@qidizi everything seems as expected, for the following code:

<?php

require 'vendor/autoload.php';

$start = microtime(true);
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$time = microtime(true) - $start;
echo ($time * 1000) . PHP_EOL;

Then most time is spent in booting up composer, and only ~11% of time is spent in our code, as expected. And even then our code is mostly trigerring autoloading. So really nothing out of the ordinary. And probably nothing we could change.

That code output ~5 ms. That seems to be 100 faster that your measure. Since my machine is about 5 years old, it could be even faster than that. You probably have something else interfering with your measure...

jbardnz
@jbardnz
Hi all, I was wondering if anyone could take a look at my issue reading custom number formats I posted on SO here: https://stackoverflow.com/questions/62630543/how-to-get-custom-number-formats-in-phpspreadsheet
ikmalil birri
@malikmal98_gitlab
Hi all, I want to ask. how to change the color of line chart and series to no fill. ? so that's will show the line only. and the background is no fill or trasnparant.
Francois Pienaar
@francoispienaar
Hi guys. When exporting a spreadsheet with custom number formatting (e.g. '# ##0.00'), the PDF export fills in ALL of the #'s with 0's. So, if I have a cell with the a 0 value in one of those column, it ALWAYS returns the cells with the padded zeros filling in the #'s, so 0 000.00 in this case. How do I get rid of this behaviour? I'm using mPDF 8.0 with PHPSpreadsheet 1.13
Richard Wagreich
@rwagreich_gitlab
I was wondering if anyone has been able to identify how to change the fill color of a bar chart. I have looked at the examples and it appears it should be possible and see others have tried too. But setting $fillColor does not seem to work with bar charts. Any help would be appreciated.
ikmalil birri
@malikmal98_gitlab
Thanks @rwagreich_gitlab . I see the example folder in the pie chart there is fillColor. but in my case, I want to no fill the chart and plotArea. i have been looking about PHPExcel raw using $objWriter->startElement(a:noFill). I think it is possible to no fill the chart and plot area. but I don't know what the meaning of (a: , c: etc) In that's parameter. and how to write it to phpspreadsheet
Timothy Choi
@tyteen4a03
Screenshot 2020-07-01 at 16.15.36.png
Screenshot 2020-07-01 at 16.18.57.png
Same issue with Worksheet::calculateColumnWidths
Timothy Choi
@tyteen4a03
Also what's the performance implication of Worksheet::setSelectedCells? It looks like it's stretching way beyond the data I would have in my spreadsheet
Timothy Choi
@tyteen4a03
Hi - I am applying some styling to my spreadsheet with ~50 rows by iterating through all cells and using $style = $cell->getStyle(); to apply the styling I want. This turns out to be very expensive (see above). The styling is the same for entire columns; how do I speed this up?
Timothy Choi
@tyteen4a03
Switching to getStyle() and applyFromArray() without creating object references seem to have shaved off 5 seconds
Mark Baker
@MarkBaker
@francoispienaar the space is almost certainly confusing the internal format parser, are you trying to create a locale-specific format?
Francois Pienaar
@francoispienaar
Hi @MarkBaker. Yeah, specifically for en-ZA, which uses spaces as a thousands separator. I've had a cursory look at the Number Formatting process in the HTML writer, and it looks like #'s are greedily replaced with 0's, but I haven't dug deep enough to figure out exactly how the formatting works. However, as I'm typing this I'm realising that there are static setter functions to set thousands and decimal separators, so I will see if those solve my problem, combined with '0.00' and '0.000' formatting masks. 😅
Mark Baker
@MarkBaker
So just use the standard #,##0.00 format mask
Adrien Crivelli
@PowerKiKi
@tyteen4a03 see "It is recommended to style many cells at once" in https://phpspreadsheet.readthedocs.io/en/latest/topics/recipes/#styles
Timothy Choi
@tyteen4a03
@PowerKiKi yeah I initially dismissed that because it seems to have made performance worse, but it turns out I was doing something dumb
Richard Wagreich
@rwagreich_gitlab
I have recently installed phpspreadsheet onto my localhost (XAMPP environment) using composer. I would like to transfer everything to run in a linux environment rather than use composer in to install. If anyone can point me to details whether this is a problem and/or which files must be transferred and best practices, please let me know.
asif1981
@asif1981
Hi
Want to read password protected sheet
I m new and want to get data of password protected excel sheey
Adrien Crivelli
@PowerKiKi
Richard Wagreich
@rwagreich_gitlab
Thank you @PowerKiKi. It is working well.
asif1981
@asif1981
@adrien criveli thabks.
Thanks
Want to read that cell value which has if condition.
asif1981
@asif1981
Using rangeToArray(A1:F12,NULL)
Show error uncaught phpoffice....exception: Latest D5 ->formula error
asif1981
@asif1981
When read data from sheet1 Fatal error formula error. cell get reference from other sheet2. Any solution?
Cell has formula.
piyushprakashpujari
@piyushprakashpujari
can u please help me phpspreadsheet can run on php 5.4?
Adrien Crivelli
@PowerKiKi
@piyushprakashpujari no, it cannot run on PHP 5.4. Latest PhpSpreadsheet requires an officially maintained PHP version. Right now that means 7.2 or later
Vivan Menezes
@goalmaker
i am running php7.0
need to install phpspreadsheet
help
Adrien Crivelli
@PowerKiKi
@goalmaker you cannot install latest version of PhpSpreadsheet on PHP 7.0. But if you let composer make the choice for you it will pick an old version that matches your PHP version
Mark Baker
@MarkBaker
@PowerKiKi I've a couple of Merge requests that could use some testing and review, one for page Order in print settings, the second for named formulae and named ranges... would appreciate any feedback
Adrien Crivelli
@PowerKiKi
@MarkBaker thanks for the heads up, I'll see what I can to this week-end
DrDeath72
@DrDeath72
somebody help me... can't check empty strings "" in =SUMIFS condition
in excel show 0, when click on formula = and apply, start calculate, looks like some double quotes problem, but i don't understand how fix it
DrDeath72
@DrDeath72
if replace empty string in cells to 0 and in function "" to 0 get error
A non-numeric value encountered
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php(1489)
1488 if ($valid) {
1489 $returnValue += $value;
1490 }
Adrien Crivelli
@PowerKiKi

@MarkBaker I was wondering what you thought about dropping phpcs and keep only php-cs-fixer ?

I feel both tools are similar for our use-case. phpcs might offer more possibilities, but we don't use, nor need, them. I feel the workflow with php-cs-fixer much easier, especially to auto-fix. And I think it might be faster. Even though php-cs-fixer does not offer support for PSR-18 yet (it's coming), I feel it already is capable of enforcing a good enough code style. What do you think ?

Mark Baker
@MarkBaker
Well I have personal reasons for preferring phpcs, which also has its own fixer (phpcbf) with its dry run mode, and modes of updating/patching files... the main developer lives about 5km from me, and i see her regularly, and know how much time and effort she puts into phpcs, especially now in the run-up to php8
And phpcs does also provide us with the very useful version check with phpcompatibility.
Adrien Crivelli
@PowerKiKi
let's keep it then
Grae Buenaventura
@gr4e
Hi! newbie here. was wondering if anybody can help me install phpspreadsheet in a local joomla?
WhiskeyReserve
@WhiskeyReserve
Loving the capability of PHPSpreadsheets. I was hoping for a little guidance on making a scatter chart be value based on the x-axis rather than categorical. The biggest issue is displaying values on the x-axis that are not integers (such as 0.5, 0.75, 1.5, etc.) . The easiest way to demonstrate is to change the scatter demo to decimals. Any suggestions?