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/10/31 20:00:06 UTC
setting page breaks with setRowBreak(row) still get other breaks too
Hi all,
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.
I am new to this list, but I have googled and read the
page break questions on the list and still cannot
resolve.
Any ideas would be appreciated.
Thanks,
Laurel
____________________________________________________________________________________
Everyone is raving about the all-new Yahoo! Mail
(http://advision.webevents.yahoo.com/mailbeta/)
---------------------------------------------------------------------
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/