Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Marcus Uerlings
@muerlings_twitter

I´m having a probem with HTML writer when adding nuber format like:
'- * #,##0.00-;[Red]- #,##0.00-;- "-"??-;-@_-'

It displays with html tag span and style on browser

instead of just displaying the number in red.
Does someone had the same problem?
Sean Pearce
@smpita
PHPSpreadsheet edited spreadsheets are breaking CenturyLink's efax service resulting in an empty cells if it's formatted as currency. If the document is opened in Excel and immediately saved, the spreadsheet faxes normally. This issue occurs regardless of the type of change made by PHPSpreadsheet -- currently we're just resizing columns from a downloaded report. The unedited report faxes normally. Any ideas?
Fräntz Miccoli
@frantzmiccoli

@MarkBaker thanks for your reply on PHPOffice/PhpSpreadsheet#788 do you think that it is feasible to "hack" the stack based parser in order to give a specific processing to IF calls ?

I am deep in processTokenStack(), still trying to figure what's happening around. If you think it is close to impossible to implement something without generating side effects I will stop there.

Maria Fernanda Orozco Dominguez
@mariaorozco18_gitlab
Buenos dias
alguien por aqui?
Tengo una duda con la libreria y me gustaria saber si me pueden colaborar
Mark Kevin Besinga
@besingamkb
hi. I have a cell that has a float or a double type value. how can I get the cell but in the string format?
Mark Baker
@MarkBaker
Well PHPSpreadsheet has a getFormattedValue() method if the cell has a number format mask... or PHP has functions like number_format()... or even just cast the value to a string
Diego Drigani
@drigani
Hi All! I've a problem with the calculated value on an array formula {=+MIN(IF(AF4:BN4>0;AF4:BN4;""))}
are they supported?
Adrien Crivelli
@PowerKiKi
@drigani no, they are not supported
dirtyluke
@dirtyluke
it seems that PhpSpreadsheet doesn't get chart in when its description wrapped by a oneCellAnchor tag in the drawing.xml file (xlsx type file)
Paul Porzky
@papoms

Hi there,

given an existing xlsx file with lots of formulas and formatting
i want to add some data and write it to a new file.
currently it breaks Formulas and Formatting in the output, even without changes.

$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load('complextemplate.xlsx');
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
$writer->save("output.xlsx");

Is there a more unobstrusive way of adding data to an existing XLSX File? (Also open for suggestions of other tools / libraries)

Just reading and writing the file results in a corrupted result. Just wondering whether or not i am missing an option or something from the docs to make changes to a file without recreating it complete within PhpSpreadsheet.

Fräntz Miccoli
@frantzmiccoli
I don't know if you only check PR where CI failed, but here PHPOffice/PhpSpreadsheet#816 I don't understand why phpcs is seeing two blank lines when there is only one.
Fräntz Miccoli
@frantzmiccoli
  • where CI didn't fail
Adrien Crivelli
@PowerKiKi
@papoms there is no option to "only add something". It's always a complete rewrite of the entire file. If something changes, then it means it's not supported by the reader and/or the writer. The best course of action is to find out what is missing for your need and contribute the feature. Or find another tool, but I can't recommend any
Fräntz Miccoli
@frantzmiccoli

Hi, I am observing that if A2 contains =HLOOKUP(A1, D1:AC120, 3, FALSE), it works fine if unused lines in the range are using A2 (which otherwise would be a circular reference). Which is consistent with the behavior of spreadsheet software.

But I don't get in the code which part of the calculation engine is handling that and I am observing a bug related to this. One of the "would-be" circular reference is resolved to some value, used in another result that is then cached and retrieved later ... without a proper recomputation.

Mark Baker
@MarkBaker
@PowerKiKi WIth PHP 7.0 officially already at end of life, and 5.6 due to end security-patch support in just 2 days, do you have any strong opinions on whether we should put the minimum PHP version at 7.1 for the next major release? or still provide 7.0 compatibility? With working on the new calc engine, I'm debating whether to use nullable return typehints, which requires 7.1
I'm also going to split off a new developmentVersion2 branch for working on updating for the newer features of PHP7
Mark Baker
@MarkBaker
For the moment I'll leave the composer.json at ^7.0 and set up travis for 7.0, 7.1, 7.2, 7.3
Mark Baker
@MarkBaker
And I'll run a branch off that for my work on the new calc engine.... changes to the actual functions are relatively minor; though the largest is throwing an exception for "Excel" errors (invalid arguments, etc) rather than returning a string containing the error (#VALUE, #NA!, etc); though the function code can be improved as a result of that change
Adrien Crivelli
@PowerKiKi

@MarkBaker we should definitely go with PHP 7.1, otherwise type hinting cannot be as useful as it should be.

For branching I was considering keeping only master branch as a permanent branch. I noticed that develop is not really useful because it should be as stable as possible anyway. So we could just as well merge into master directly (and release from time to time as usual). This simplify our workflow, avoid confusion for new contributors and avoid accidental branch diverging as it happened when releasing 1.5.2.

Adrien Crivelli
@PowerKiKi
I'll take care of removing the develop branch, if that is ok with you ?
Mark Baker
@MarkBaker
👍
Adrien Crivelli
@PowerKiKi
just released 1.6.0
Fräntz Miccoli
@frantzmiccoli

Hi @PowerKiKi

I saw you closed PHPOffice/PhpSpreadsheet#818 this won't be merged ?

jbtsp
@jbtsp
I have seen no info from anyone about this issue PHPOffice/PhpSpreadsheet#770
I think I followed the "correct approach to requesting a feature enhancement". I thought I might have at least a comment or 2 about this.
link97381
@link97381
Can anybody tell me if it's possible to add a Form Control Button to my spreadsheet to activate a macro(I already managed to figure out the process of adding the macro)?
Adrien Crivelli
@PowerKiKi
Megladon
@IPMegladon
Hi I have tried various ways and want to know if PhpSpreadsheet supports graph with a secondary y-axis and if not if there is any alternative or patch I can use to do this. I am opening up a template spreadsheet and inserting values for the charts. Furthermore is there a way I can set the font elements of the graphs or simply prevent the font size and type from changing when I open and then save the template file. Thanks!
sasr22
@sasr22
Hey! I am having problems with removing a row from a worksheet, I am trying to remove it like this
$spreadsheet->getActiveSheet()->removeRow(RowNum);
Mark Baker
@MarkBaker
What problem are you having with removeRow() @sasr22 ? What does it do? Does it error?
@IPMegladon There's no code in the charting for PhpSpreadsheet that works with a secondary axis, if you want to provide a patch, we're always happy to accept contributions
sasr22
@sasr22
@MarkBaker I feel so dumb, the function works fine, I how ever, don't work fine as I forgot to import PHPSpreadsheet. After I imported it it worked fine.
akalogiros
@akalogiros
anyone knows if phpspreadsheet supports poisson.dist calculations?whenever i try to get a cell calculated field with Poisson ,script crashes.
Fräntz Miccoli
@frantzmiccoli
@akalogiros find . |grep -s POISSON comes back empty handed so I guess it's not
Rubén Rubio
@rubenrubiob

Hi!

I am trying to read a XLS spreadsheet and I want all values to be strings, i.e., I do not want them to cast to any type. The problem I have is that I have some large numbers that are EAN codes, and the readers converts them to float with scientific notation, therefore, not valid numbers. For example, I have the code 123456789012345000 that is read as 1.2345678901234E+17.

I have tried many options to achieve this, trying to use a custom ValueBinder, as it seems the most legit option. This is the code I have:

$binder = new class extends DefaultValueBinder {
    public function bindValue(Cell $cell, $value)
    {
        $cell->setValueExplicit($value, DataType::TYPE_STRING);
        return true;
    }
};

Cell::setValueBinder(
    $binder
);

$reader = IOFactory::createReaderForFile($path);
$reader->setReadDataOnly(true);
$spreadsheet = $reader->load($path);

$rows = $spreadsheet->getActiveSheet()->toArray(null, false, false);

No matter what I try, I can not get it to work, it never goes through my ValueBinder, and I have not found anything in the documentation. Any help?

Thank you!

Fräntz Miccoli
@frantzmiccoli
@rubenrubiob I don't know the innerworkings of setValueExplicit but the casting of your value to string it probably the normal one in PHP. Check this https://stackoverflow.com/questions/1471674/why-is-php-printing-my-number-in-scientific-notation-when-i-specified-it-as-00 you might find a few useful hints.
Rubén Rubio
@rubenrubiob

Yes, I know that that happens. The thing is that I lose precision in the number. For example, 123456789012345000 becomes "123456789012344992.000000" when I do an sprintf('%f', $var). But it is not a number, it is a string, and I want it to be read as string in the beginning; if it is read as a string and not as a number, I think I will be able to solve the problem.

I will keep looking for a solution.

Thanks for your answer @frantzmiccoli !

Another thing is that the reader never calls my ValueBinder, so line

$cell->setValueExplicit($value, DataType::TYPE_STRING);

is never called.

Fräntz Miccoli
@frantzmiccoli
never used that, no clue
chimes325
@chimes325
When I used phpspreadsheet to load excel, I found that it read the calculation formula filled in the form. Is there any way to read the final value of the form? thx
Judah Wright
@judahnator_gitlab
Howdy folks!
I am working on a problem and my google-fu is not cutting it. The gist is I need to make sure that text does not overflow a cell, with the problem being that I am using merged cells and Excel does not support auto-height with merged cells. SO, is there a simple way to check if the text in a given cell is overflowing? If so I could increment the row height until all text is visible.
chimes325
@chimes325
@PowerKiKi thanks for u help!
Tolga Ozses
@kartagis
hello
I have an issue, and it would be too long to describe it here. I'm wondering if it's a bug. Would anyone be so kind to look at https://drupal.stackexchange.com/q/275922/17632 ?
Adrien Crivelli
@PowerKiKi
@kartagis not a bug in PhpSpreadsheet. You are most likely not giving a path on disk to an existing file, but instead giving some sort of URL or custom Drupal path references