You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by la...@yahoo.com on 2006/11/14 18:40:14 UTC

setting page breaks with setRowBreak(row) still get other breaks too

Hi,

Has anybody successfully dealt with setting page
breaks in .xls where you fully control where the
breaks go?

Thanks!

My earlier post:

I have an HSSF page break problem.  I need to insert
page breaks manually after certain rows.

I have a rather large spreadsheet. The code below
worked fine and fit to one page which was the original
request.  Then I was asked to page break at certain
rows in the spreadsheet so that it would be 3 pages
depending on data.

 HSSFPrintSetup ps = sheet.getPrintSetup();      
sheet.setAutobreaks(true); 			
         ps.setFitHeight((short) 1); 
	 ps.setFitWidth((short) 1); 
	 ps.setHeaderMargin (.20);    
         ps.setFooterMargin (.25); 
         ps.setPaperSize((short) 5); // legal

I tried adding my own row breaks with this:
  sheet.setRowBreak(rownum);

but it ignored my breaks due to autobreaks. If I leave
the autobreaks line out, it has my manual breaks and
many more, making it 12 pages.  

I thought I could find all breaks and manually remove
the automatic ones, but with 

       breaks = sheet.getRowBreaks();
However, I only get my own breaks into the array.



 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/