* @author Glen Stampoultzis (glens at apache.org)
* @see org.apache.poi.hssf.model.Workbook
* @see org.apache.poi.hssf.usermodel.HSSFSheet
+ * @author Shawn Laubach (laubach at acm.org) Just Gridlines, Headers, Footers, and PrintSetup
* @version 1.0-pre
*/
protected DefaultColWidthRecord defaultcolwidth = null;
protected DefaultRowHeightRecord defaultrowheight = null;
protected GridsetRecord gridset = null;
+ protected PrintSetupRecord printSetup = null;
+ protected HeaderRecord header = null;
+ protected FooterRecord footer = null;
+ protected PrintGridlinesRecord printGridlines = null;
protected MergeCellsRecord merged = null;
protected int mergedloc = 0;
private static POILogger log =
rec = null;
}
}
+ else if (rec.getSid () == PrintGridlinesRecord.sid)
+ {
+ retval.printGridlines = (PrintGridlinesRecord) rec;
+ }
+ else if (rec.getSid () == HeaderRecord.sid)
+ {
+ retval.header = (HeaderRecord) rec;
+ }
+ else if (rec.getSid () == FooterRecord.sid)
+ {
+ retval.footer = (FooterRecord) rec;
+ }
+ else if (rec.getSid () == PrintSetupRecord.sid)
+ {
+ retval.printSetup = (PrintSetupRecord) rec;
+ }
+
if (rec != null)
{
records.add(rec);
records.add(retval.createDelta());
records.add(retval.createSaveRecalc());
records.add(retval.createPrintHeaders());
- records.add(retval.createPrintGridlines());
+ retval.printGridlines = (PrintGridlinesRecord) retval.createPrintGridlines ();
+ records.add (retval.printGridlines);
retval.gridset = ( GridsetRecord ) retval.createGridset();
records.add(retval.gridset);
records.add(retval.createGuts());
( DefaultRowHeightRecord ) retval.createDefaultRowHeight();
records.add(retval.defaultrowheight);
records.add(retval.createWSBool());
- records.add(retval.createHeader());
- records.add(retval.createFooter());
+ retval.header = (HeaderRecord) retval.createHeader ();
+ records.add (retval.header);
+ retval.footer = (FooterRecord) retval.createFooter ();
+ records.add (retval.footer);
records.add(retval.createHCenter());
records.add(retval.createVCenter());
- records.add(retval.createPrintSetup());
+ retval.printSetup = (PrintSetupRecord) retval.createPrintSetup ();
+ records.add (retval.printSetup);
retval.defaultcolwidth =
( DefaultColWidthRecord ) retval.createDefaultColWidth();
records.add(retval.defaultcolwidth);
}
return null;
}
+
+ /**
+ * Returns the HeaderRecord.
+ * @return HeaderRecord for the sheet.
+ */
+ public HeaderRecord getHeader ()
+ {
+ return header;
+ }
+
+ /**
+ * Sets the HeaderRecord.
+ * @param newHeader The new HeaderRecord for the sheet.
+ */
+ public void setHeader (HeaderRecord newHeader)
+ {
+ header = newHeader;
+ }
+
+ /**
+ * Returns the FooterRecord.
+ * @return FooterRecord for the sheet.
+ */
+ public FooterRecord getFooter ()
+ {
+ return footer;
+ }
+
+ /**
+ * Sets the FooterRecord.
+ * @param newFooter The new FooterRecord for the sheet.
+ */
+ public void setFooter (FooterRecord newFooter)
+ {
+ footer = newFooter;
+ }
+
+ /**
+ * Returns the PrintSetupRecord.
+ * @return PrintSetupRecord for the sheet.
+ */
+ public PrintSetupRecord getPrintSetup ()
+ {
+ return printSetup;
+ }
+
+ /**
+ * Sets the PrintSetupRecord.
+ * @param newPrintSetup The new PrintSetupRecord for the sheet.
+ */
+ public void setPrintSetup (PrintSetupRecord newPrintSetup)
+ {
+ printSetup = newPrintSetup;
+ }
+
+ /**
+ * Returns the PrintGridlinesRecord.
+ * @return PrintGridlinesRecord for the sheet.
+ */
+ public PrintGridlinesRecord getPrintGridlines ()
+ {
+ return printGridlines;
+ }
+
+ /**
+ * Sets the PrintGridlinesRecord.
+ * @param newPrintGridlines The new PrintGridlinesRecord for the sheet.
+ */
+ public void setPrintGridlines (PrintGridlinesRecord newPrintGridlines)
+ {
+ printGridlines = newPrintGridlines;
+ }
+
}
* @author Andrew C. Oliver (acoliver at apache dot org)
* @author Glen Stampoultzis (glens at apache.org)
* @author Libin Roman (romal at vistaportal.com)
+ * @author Shawn Laubach (laubach at acm.org) (Just a little)
*/
public class HSSFSheet
return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid))
.getRowSumsRight();
}
+
+ /**
+ * Returns whether gridlines are printed.
+ * @return Gridlines are printed
+ */
+ public boolean isPrintGridlines() {
+ return getSheet().getPrintGridlines().getPrintGridlines();
+ }
+
+ /**
+ * 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) {
+ getSheet().getPrintGridlines().setPrintGridlines(newPrintGridlines);
+ }
+
+ /**
+ * Gets the print setup object.
+ * @return The user model for the print setup object.
+ */
+ public HSSFPrintSetup getPrintSetup() {
+ return new HSSFPrintSetup(getSheet().getPrintSetup());
+ }
+
+ /**
+ * Gets the user model for the document header.
+ * @return The Document header.
+ */
+ public HSSFHeader getHeader() {
+ return new HSSFHeader(getSheet().getHeader());
+ }
+
+ /**
+ * Gets the user model for the document footer.
+ * @return The Document footer.
+ */
+ public HSSFFooter getFooter() {
+ return new HSSFFooter(getSheet().getFooter());
+ }
}