Hi,

I ran into a problem using POI (first 3.6, then tried the latest 3.7
with the same result) and print settings.

I have a input xlsx file that has some print settings (e.g. scale 48%,
landscape, margins).

After some manipulations I'm wanting to set the Rows to repeat at top
via something like

w.setRepeatingRowsAndColumns(s, -1, -1, 0, 5);

After I save this workbook, the print settings are lost.

Digging through the sources, I found that this method does a call to
sheet.getPrintSetup(). It turns out that this call is doing something
bad. In fact, doing a simple test like so will trigger the problem:

1/ read xlsx file with print settings
2/ call s.getPrintSetup() on a sheet (without doing anything else)
3/ save the xlsx file
-> your print settings are going.

Unzipping the resulting .xlsx files and looking at the difference
shows that the entire < pageSetup > tag is gone.
In fact, if you do s.getPrintSetup() and set the scale
programmatically, the saved .xlsx file still doesn't have a <
pageSetup >.

I'm hoping somebody from POI has a bit of time to look into this - I'm
really hoping to use this functionality...

Thanks much,
- Filip

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to