Well well... we just had a request for landscape printing this morning, and here we have a patch. Oh for the joys of open source development ;-)
Quoting [EMAIL PROTECTED]: > DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG > RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT > <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8515>. > ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND > INSERTED IN THE BUG DATABASE. > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8515 > > [Patch] Headers, Footers, Gridlines, and Print Setup > > Summary: [Patch] Headers, Footers, Gridlines, and Print Setup > Product: POI > Version: unspecified > Platform: Other > OS/Version: Other > Status: NEW > Severity: Normal > Priority: Other > Component: HSSF > AssignedTo: [EMAIL PROTECTED] > ReportedBy: [EMAIL PROTECTED] > > > These are a set of additions to add and modify the page headers, footers, > whether gridlines are printed, and the print setup which includes landscape > > mode, margins, and such. > > Index: src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java > =================================================================== > RCS file: /home/cvspublic/jakarta- > poi/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java,v > retrieving revision 1.4 > diff -u -r1.4 HSSFSheet.java > --- src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java 14 Mar 2002 > 11:05:04 -0000 1.4 > +++ src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java 25 Apr 2002 > 13:30:34 -0000 > @@ -756,4 +756,84 @@ > return (( WSBoolRecord ) > sheet.findFirstRecordBySid(WSBoolRecord.sid)) > .getRowSumsRight(); > } > + > + /** > + * Returns whether gridlines are printed. > + * @return Gridlines are printed > + */ > + public boolean getPrintGridlines() { > + Iterator i = getSheet().getRecords().iterator(); > + while (i.hasNext()) { > + Record r = (Record)i.next(); > + if (r.getSid() == PrintGridlinesRecord.sid) { > + PrintGridlinesRecord pgr = (PrintGridlinesRecord)r; > + return pgr.getPrintGridlines(); > + } > + } > + return false; > + } > + > + /** > + * Turns on or off the printing of gridlines. > + * @param newPrintGridlines boolean to turn on or off the printing of > + * gridlines > + */ > + public void setPrintGridlines(boolean newPrintGridlines) { > + Iterator i = getSheet().getRecords().iterator(); > + while (i.hasNext()) { > + Record r = (Record)i.next(); > + if (r.getSid() == PrintGridlinesRecord.sid) { > + PrintGridlinesRecord pgr = (PrintGridlinesRecord)r; > + pgr.setPrintGridlines(newPrintGridlines); > + } > + } > + } > + > + /** > + * Gets the print setup object. > + * @return The user model for the print setup object. > + */ > + public HSSFPrintSetup getPrintSetup() { > + Iterator i = getSheet().getRecords().iterator(); > + while (i.hasNext()) { > + Record r = (Record)i.next(); > + if (r.getSid() == PrintSetupRecord.sid) { > + PrintSetupRecord psr = (PrintSetupRecord)r; > + return new HSSFPrintSetup(psr); > + } > + } > + return null; > + } > + > + /** > + * Gets the user model for the document header. > + * @return The Document header. > + */ > + public HSSFHeader getHeader() { > + Iterator i = getSheet().getRecords().iterator(); > + while (i.hasNext()) { > + Record r = (Record)i.next(); > + if (r.getSid() == HeaderRecord.sid) { > + HeaderRecord hr = (HeaderRecord)r; > + return new HSSFHeader(hr); > + } > + } > + return null; > + } > + > + /** > + * Gets the user model for the document footer. > + * @return The Document footer. > + */ > + public HSSFFooter getFooter() { > + Iterator i = getSheet().getRecords().iterator(); > + while (i.hasNext()) { > + Record r = (Record)i.next(); > + if (r.getSid() == FooterRecord.sid) { > + FooterRecord hr = (FooterRecord)r; > + return new HSSFFooter(hr); > + } > + } > + return null; > + } > } >
