PHPOffice/PHPExcel

Row auto height broken in Libre Office?

firegate666 opened this issue ยท 21 comments

I tried to auto a row/cell with PHPExcel. It works awesome when I open the document with Excel itself, but it does not work with Libre Office.

I tried $sheet->getRowDimension($row_no)->setRowHeight(-1); and $sheet->getDefaultRowDimension()->setRowHeight(-1);. It does not work.

I found this old bug report here: https://phpexcel.codeplex.com/discussions/429322

Unfortunately the provided solution does not work.

Any ideas on this topic?

I seem to suffer from the same problem. Any solutions so far? Here's the code I use:

https://gist.github.com/mikehaertl/280455b503dc8c4ccddd

๐Ÿ‘ auto height not working

5.0.5.2, still not working.

@MarkBaker Did you get a chance to look into this issue? It's too bad, that automatic line height in LibreOffice is broken for files generated with PHPExcel:

phpexcel_rowheight

Maybe there's at least a workaround?

A workaround would be very helpful.

Row auto height still not working.

still have this issue

@DaumantasPHP, please provide a Minimal, Complete, and Verifiable example of code that exhibits this issue. And don't forget to mention what version of this project you are using. That way there will be more chance for the issue to be solved.

Here's an xls file created with PhpExcel, similarly how the above bug report reported it.
I attached a screenshot of it from LibreOffice Calc 4.2.8.2, and the preview with the expected behaviour from Google Drive.
phpexcel.zip

The developers of PHPExcel apologise that they cannot fix bugs in LibreOffice Calc; but this is a known LibreOffice bug when importing Excel files

@MarkBaker Thanks. Could you maybe point us to any sources about this known issue in LibreOffice? I could not really find something.

I also understand that your library focusses on Excel - but wouldn't it be great if it also worked flawlessly with the alternatives? I may be wrong, but I think Excel as well as other spreadsheet software should all comply with the open document format, right? If so, then couldn't phpoffice also be geared to that standard? Because I somehow feel, that LibreOffice is probably closer to the standard than Excel. So if auto lineheight is specified in that standard it would be great to see support in phpoffice for it - and rather build a workaround for MS office.

I may be totally wrong with my assumptions, though.

Closing as per Mark's comment.

Thanks ๐Ÿ‘Ž

@mikehaertl, despite its name PHPExcel is not really geared toward a specific product, but rather a file format. So if you are able to find that there is indeed something wrong in the file generated by PHPExcel, I will gladly review it.

But I wasn't able to find anything myself. And that's why I relied on Mark's expertise on the topic to close this issue.

Hi @MarkBaker , do you have the bug number in LibreOffice Calc so we can follow up there?

str commented

Is it really a LibreOffice bug? Where can I verify it?

str commented

@MarkBaker That issue is related to column width, not row height.

Then I'd need to double-check.... my original reference was on the original bug list on CodePlex, which has since been deleted

I think this might be related: https://bugs.documentfoundation.org/show_bug.cgi?id=62268

the height bug seems to be present since 2013... disappointing.

I came across this thread while trying to resolve a similar problem in my own PHP-based Excel code. It may be similar enough that the solution I eventually found can be used in PHPExcel.

I wondered if LibreOffice expected a very specific order for the DEFAULTROWHEIGHT record, so I moved it after the COLINFO records and it worked! It's different to what the spec says, but I checked a sample and it still opened correctly in Excel and in OpenOffice Calc.

Maybe this will help someone. Good luck!