Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
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
Tolga Ozses
@kartagis
@PowerKiKi it was a typo on my side. I used ::createReaderFromFile($uri) and ::load($filename)
Fräntz Miccoli
@frantzmiccoli
@MarkBaker do you think you would have time to give a look at? PHPOffice/PhpSpreadsheet#844 (see also PHPOffice/PhpSpreadsheet#818 )
Infernus
@Infernus101
hello anyone there?
need help to setup phpspreadsheet with codeigniter
Khine Wai Oo
@khinewaioo_gitlab

Hello? Anyone in here?
I setup the page my excel file with Page Layout view and width.
getSheetView()->setView(SheetView::SHEETVIEW_PAGE_LAYOUT) and
getPageSetup()->setFitToWidth(1);

The problem is that I start the excel with Microsoft 2007, Pagesetup width is not work.
When I click anything in menu of excel.
Pagesetup width is work.

Is it problem of Excel or Is there any code to solve that problem?

JMLucas
@JMLucas96
When I use $writer->save($filename); on wich location is saving file?
JMLucas
@JMLucas96

When I use

$writer->save("/wp-content/uploads/exports/test.xlsx");

I get following error

Could not close zip file /wp-content/uploads/exports/prova.xls.

JMLucas
@JMLucas96
solved
Med-Seif
@Med-Seif
HI!
Med-Seif
@Med-Seif

Is there a way to apply a border style for a range of cells other than the default method :

$spreadsheet->getActiveSheet()->getStyle('A1:E10')->getBorders()->getTop()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK);

This method applies the border for the whole block and not each cell

Fräntz Miccoli
@frantzmiccoli
@Med-Seif I am pretty sure you have utilitary function than could give you a cell array from a cell range. like A1:E10 --> ['A1', 'A2', ...]
amosfolz
@amosfolz

@Med-Seif I think you may find this helpful: https://phpspreadsheet.readthedocs.io/en/develop/topics/recipes/#styles
You can use allBorders like

$stlyes = [
  'borders' => [
        'allBorders' => [
            'borderStyle' => Style\Border::BORDER_THICK,
        ]
]

This will apply border to each cell in the range you have selected, rather than to just the outer cells.

Miguel Ángel Sánchez Palafox
@gueroverde
Hello, there is a way to format as a table?
Angelo D'Errico
@angeloderrico_gitlab
Hello, there is anyone that solved secondary Y-Axis for Charts?