Open rf1234 opened 2 years ago
What version of PhpSpreadsheet are you running?
I run PHPSpreadsheet version 1.2.1 for this sheet.
I have to run multiple different versions for my needs: One version doesn't do XLSM sheets, the other one doesn't do graphs properly. In total I run 1.2.1, 1.3.1 and 1.6.0
1.2.1 is a very ancient version (released Mar 04, 2018); even 1.6.0 is old (released Jan 02, 2019). Can you please try running against an up-to-date version of PhpSpreadsheet: the current latest release is 1.24.1 (from July 18th this year)
I was afraid that was going to happen, Mark! It will be really difficult for me because I had to implement a couple of hacks in PHP Spreadsheet but I will try.
Do you have any other idea for me, please?
I remember implementing a hack for a "secondary Y-axis" in one of the versions I use. That had been a pull request for some time. Has "secondary Y-axis" been implemented at all?
Roland
I couldn't say if secondary Y-axis has been implemented or not; but @oleibman may be able to answer, he has made significant improvements in chart handling in the last 6 months
Hi Mark,
just ran my report with 1.24.1 - and the error disappeared. Thank god this report is a simple report - so it looks ok. For some time I will be using four different PHP Spreadsheet versions in parallel then.
I just searched for "secondary" in my different versions of PHP Spreadsheet. Nothing in version 1.24.1. In my hacked versions I have 75 occurences each. I even made an example with it, but don't recall how to use the examples. It is a long time ago since I built this stuff!
Here is a link to a question that includes a link to a pull request on secondary Y-axis. I remember there had been more pull requests. I copied my solution from a different pull request though. https://github.com/PHPOffice/PhpSpreadsheet/issues/1072
Roland
Sorry, no secondary axis yet. If you want to open a feature request, preferably with a simple example or two, I can put it on my to-do list. I will certainly look at the PR you linked above.
You may find that some of the other issues that mean you need to run multiple different versions of PhpSpreadsheet have also been resolved over the last five years, and that you can run 1.24.1 instead of some of those other versions
Thanks, guys!
Didn't find the examples in the downloaded package of the new release. Are they in a new location now?
Didn't find the examples in the downloaded package of the new release. Are they in a new location now?
They're not included in the download because too many people were moaning that it made the download too big; so they're only visbible here in the repo, of it you do a git clone to pull the repo
too many people were moaning that it made the download too big
I would really like to have the problems those people have ... Thanks again for your quick help!!
In the meantime I have managed to migrate three of my 25 reports to the new PHP Spreadsheet version. I also tried with a graphic report that doesn't use secondary Y-axis - and it crashed immediately. Nothing in the console but a broken Excel file was the result. Unfortunately that has been the case with all versions higher than 1.2.1 that I have tried with these reports.
I attached a sample file that I created with version 1.2.1 The first two sheets of the workbook are monthly and quarterly views. The remaining sheets are usually "very hidden" and serve as data sources.
Any idea why this doesn't work with subsequent versions?
I also attached the broken file created by version 1.24.1. That is the second file attached.
MarktZinsenDevisen_2022-06-30 (3).xlsx MarktZinsenDevisen_2022-06-30 (1).xlsx
I agree that I see a problem with the newer version. But your spreadsheet has 12 charts! Is it possible, for starters, to give me a fighting chance by creating a spreadsheet with only one chart that works in the old version and fails in the new?
Hmmm, I am afraid I don't have any simple use cases. I wrote this stuff about four years ago.
I was able to resolve my immediate problems with the new version now. Hope I will survive with the hacked old version for a few more weeks ... Because I will be traveling the next months and probably will only be able to look into this in more detail in September or October.
So please bear with me for a while. I agree you deserve a better test case and I am willing to provide it. But I need more time. Thank you for your understanding and for your help!! I am impressed with how fast you are responding! (That was very different when I worked with PHPSpreadsheet intensively a couple of years ago.)
Best Roland
But your spreadsheet has 12 charts!
I only found six. But you are right! I have what I call "legend charts" because otherwise I couldn't display a legend in an acceptable manner using PHP Spreadsheet. Everything looked really ugly ... In a legend chart everything except for the legend is invisible. But that way the solution was much more flexible and looked a lot better!
My 25 reports consume over 16,000 lines of code ... I really gave you the most simple one, I swear ...
Just as a suggestion, each chart has to be explicitly added to the spreadsheet using $sheet->addChart($chart)
. Can you comment these out then add them back one by one till something breaks?
Yep, it's on my list!
Discussed in https://github.com/PHPOffice/PhpSpreadsheet/discussions/3009