You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by fw <fw...@fks.be> on 2007/10/22 08:45:51 UTC

HSSFSheet.getFitToPage() always returns true ?

Hi all,

I am having the following problem :

- I create 2 excel files
- In one of them I set the fit-to-ages option on (in the page-setup 
dialog) and set fit to pages to 1/5. (I do this for the first sheet in 
the workbook)
- In the other one I ensure set fit to pages is off for the 1st sheet.

- Now when I run the following code :

POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream("/tmp/test.xls"));
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
sheet.setAutobreaks(true); //I read in the bug database that getFitToPage doesn't work unless you set this to true
HSSFPrintSetup printSetup = sheet.getPrintSetup();
System.out.println(printSetup.getFitHeight()); //correctly returns 5 for the 1st file
System.out.println(printSetup.getFitWidth()); //correctly returns 1 for the 1stfile
System.out.println(sheet.getFitToPage()); //PROBLEM HERE --> Always returns true


- The problem is that the last line always returns true.

- Am I doing something wrong or is this a known problem ?

greetings,
Frank

-- 
Frank Wynants                                 frank.wynants@fks.be
fks bvba - Formal and Knowledge Systems       http://www.fks.be/
Stationsstraat 108                            Tel:  ++32-(0)11-21 49 11
B-3570 ALKEN                                  Fax:  ++32-(0)11-22 04 19 


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