You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by RE...@QVC.COM on 2009/07/07 12:03:36 UTC

Creating sheet from template leaves printSetup null

Hi,

I have got a weird problem: We use POI to create some excel sheets from 
templates like this:

                                // Reading the excel template from the 
filesystem.
                                // Because the POI api produces an error 
for 'auto filter' rows
                                // we use the template instead creating 
the sheet from the
                                // scratch.
                                POIFSFileSystem fs = new 
POIFSFileSystem(getClass().getResourceAsStream(
"/ApprovedShowsTemplate.xls"));
                                HSSFWorkbook wb = new HSSFWorkbook(fs);
                                // Only one sheet inside.
                                HSSFSheet sheet = wb.getSheetAt(0);

Yesterday I have finetuned the template (added a line, changed text...) 
and now the printSetup got lost. Means: inspecting the sheet shows that it 
has a _psBlock (PageSettingsBlock), but the _psBlock lacks the printSetup 
(PrintSetupRecord, is set to null). If I try to change a property of the 
printSetup  sheet.getPrintSetup().setLandscape(false); I get a 
NullPointerException.

With the old templates there is no problem: the sheet has a printSetup! So 
where is the difference? We use the same Excel 2003 SP 3 version with POI 
3.2 final. 

If needed I can provide the 2 Excel files.


Anyone got a clue about why the printSetup got lost?


Thanks,

Reiner Kühl

 





Reiner Kühl
IS&T Enterprise Application Development

QVC Call Center GmbH & Co. KG
Lise-Meitner-Allee 1
44801 Bochum
Telefon: 0049 - 234 - 9732 - 2866
Fax: 0049 - 234 - 9732 - 44 - 2866
eMail: Reiner_Kuehl@qvc.com
Internet: http://www.qvc.de

QVC - Ideen für mich!

Unternehmenssitz ist Düsseldorf
Eingetragen beim Amtsgericht Düsseldorf: HRA 13610
GF der Komplementärin QVC Call Center Verwaltungs-GmbH:
Neal S. Grabell, Dr. Ulrich Flatten

Danke für Ihre Kooperation!


Antwort: Re: Creating sheet from template leaves printSetup null

Posted by RE...@QVC.COM.
Thanks, Josh.

It seems to be the same error: POI 3.5 beta 6 solves the problem.

And I found that it could be a problem with MS Office Excel 2003 SP3: If I 
edit a "functioning" Excel file the same way in Office 2003 without 
Service Packs and Office 2003 SP3 then I get good results with Office 2003 
without SP. The results with Office 2003 SP3 make NPE and have a slightly 
larger file size. So Office Excel 2003 SP3 saves the sheets in a different 
way as the old one without SP.

Regards,

Reiner


Reiner Kühl
IS&T Enterprise Application Development

QVC Call Center GmbH & Co. KG
Lise-Meitner-Allee 1
44801 Bochum
Telefon: 0049 - 234 - 9732 - 2866
Fax: 0049 - 234 - 9732 - 44 - 2866
eMail: Reiner_Kuehl@qvc.com
Internet: http://www.qvc.de

QVC - Ideen für mich!

Unternehmenssitz ist Düsseldorf
Eingetragen beim Amtsgericht Düsseldorf: HRA 13610
GF der Komplementärin QVC Call Center Verwaltungs-GmbH:
Neal S. Grabell, Dr. Ulrich Flatten

Danke für Ihre Kooperation!




Josh Micich <jo...@gmail.com> 
07.07.2009 18:35
Bitte antworten an
POI Users List <us...@poi.apache.org>


An
POI Users List <us...@poi.apache.org>
Kopie

Thema
Re: Creating sheet from template leaves printSetup null






Hello Reiner,

There have been a few bugs related to the PageSettingsBlock fixed
since 3.2.  Your problem might be the same as this one:
https://issues.apache.org/bugzilla/show_bug.cgi?id=46548

Can you please try with the latest version of POI (3.5-beta6)?

If you still see the error, please open a new bugzilla, and upload
your example files there.

regards,
Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org




Re: Creating sheet from template leaves printSetup null

Posted by Josh Micich <jo...@gmail.com>.
Hello Reiner,

There have been a few bugs related to the PageSettingsBlock fixed
since 3.2.  Your problem might be the same as this one:
https://issues.apache.org/bugzilla/show_bug.cgi?id=46548

Can you please try with the latest version of POI (3.5-beta6)?

If you still see the error, please open a new bugzilla, and upload
your example files there.

regards,
Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org