Excel formatting in wbexport

maurizio.scarpis
Posts: 12
Joined: 2023-09-04 16:30:11

Excel formatting in wbexport

Post by maurizio.scarpis »

Hi Thomas.
There is a minimal issue about formatting sheets with wbexport.
I think that the "autofit" function has to be executed "after" the formatting clause of the header column and "after" the filter clause setting so the autofit will be perfect.
Thanks for paying attention to this issue.
Regards
Maurizio
support
Site Admin
Posts: 98
Joined: 2023-07-15 15:58:37

Re: Excel formatting in wbexport

Post by support »

That's the order in which it is done.
  • create the "freez pane" if requested
  • enable the auto filter
  • trigger "auto size"
In fact, after that I am actually increasing the column widths to cater for the autofilter.

The number of "characters" to be added is defined through the property workbench.export.xls.add.filterwidth.numchars - the default is 2. So if that is not enough for you, you can try increasing that number.
maurizio.scarpis
Posts: 12
Joined: 2023-09-04 16:30:11

Re: Excel formatting in wbexport

Post by maurizio.scarpis »

Thanks for the quick answer. I will try to increase the property workbench.export.xls.add.filterwidth.numchars
Regards
support
Site Admin
Posts: 98
Joined: 2023-07-15 15:58:37

Re: Excel formatting in wbexport

Post by support »

A little update:

I noticed that when opening the XLSX using LibreOffice Calc the column widths are correct (with and without the filter), even with workbench.export.xls.add.filterwidth.numchars set to zero (so no additional width applied "manually").

After some investigation, it seems that the main reason for the "incorrect" column width is caused by the default font. LibreOffice defaults to "Liberation Sans" while Excel seems to use "Calibri".

I think it might make sense to provide an option to define the font to be used in the spreadsheet.
Post Reply