Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIRT 4.14 XLSX column autofit worse than in 4.8 #1553

Closed
reiner-killet opened this issue Jan 25, 2024 · 4 comments
Closed

BIRT 4.14 XLSX column autofit worse than in 4.8 #1553

reiner-killet opened this issue Jan 25, 2024 · 4 comments
Assignees
Labels
BugFix Change to correct issues
Milestone

Comments

@reiner-killet
Copy link

Hi,
in 4.8 there was a helpful autofit of columns in XLSX output.
The respective value had to be characterized as "Preformatted".
The table column hat to be without column width.
Under the above conditions it optimized column width and height.
In 4.14 the line height is adapted like in 4.8 according to the line breaks in the cells.
But the width is not adequately resized.
The workaround would be: working with static column sizes but actually it a a loss of functionality.
Enclosed please find a report of 4.8:
Output Price List 4.8.xlsx
Here is a report of 4.14:
Output Price List 4.14.xlsx
Here is the data with pictures:
PsaRptPli.zip
And last the template (still in 4.8 mode):
PSA_RPT_PLI_ENG.zip
Or is there another method to optimze column width which I did not know?
Thanks, Reiner

@speckyspooky
Copy link
Contributor

I have checked your case and yes there is a different behavior.
There is an ExcelEmitter-property to force the auto-fit but it seems to be a changed behavior into the apache poi library for xlsx and therefore the internal calculation is a little bit optimistic for the real column size.
So I will test some details more if there is a good solution of it.

For my it is a little bit strange the behavior at all because normally the auto-fit should be work only with configured Emitter-property also in the old versions. The default setting is deactivated auto-fit. The source-code wasn't changed there. Therefore I mean it is a little bit strange.

The class where I do some testings are "AbstractRealTableHandler.endTable()" and I try to optimize it.

speckyspooky added a commit to speckyspooky/birt that referenced this issue Jan 26, 2024
@speckyspooky
Copy link
Contributor

Created PR for improve the column auto fit handling PR #1557

@speckyspooky
Copy link
Contributor

@reiner-killet
Please be aware I tested lot of cases and there are some at the office library apache poi which is used from BIRT to create XLSX. The library was updated to a newer version with BIRT 4.14 and the library includes self changes of column width colculation. Therefore we won't get the full same results of BIRT 4.8.
Additional on it there is a special XLSX-emitter-property "ExcelEmitter.ForceAutoColWidths" (type: boolean).
If it is true the full autofit handling will be activated but it could be that the reports needs more time for generation.

@speckyspooky speckyspooky added the BugFix Change to correct issues label Jan 26, 2024
@speckyspooky speckyspooky added this to the 4.15 milestone Jan 26, 2024
@speckyspooky speckyspooky self-assigned this Jan 26, 2024
@speckyspooky
Copy link
Contributor

Fix/Improvement is pushed to BIRT master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugFix Change to correct issues
Projects
None yet
Development

No branches or pull requests

2 participants