Description: sheet window settings
REFERENCE: PG 422 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org) @author Jason Height (jheight at chariot dot net dot au) @version 2.0-pre
395396397398399400401402403404
// throw new RuntimeException("You cannot have more than three sheets in HSSF 1.0"); HSSFSheet sheet = new HSSFSheet(workbook); sheets.add(sheet); workbook.setSheetName(sheets.size() - 1, sheetname); WindowTwoRecord windowTwo = (WindowTwoRecord) sheet.getSheet().findFirstRecordBySid(WindowTwoRecord.sid); windowTwo.setSelected(sheets.size() == 1); windowTwo.setPaged(sheets.size() == 1); return sheet; }
593594595596597598599600
} HSSFPrintSetup printSetup = sheet.getPrintSetup(); printSetup.setValidSettings(false); WindowTwoRecord w2 = (WindowTwoRecord) sheet.getSheet().findFirstRecordBySid(WindowTwoRecord.sid); w2.setPaged(true); }
110011011102110311041105110611071108110911101111111211131114
* headercolor = 0x40 <P> * pagebreakzoom = 0x0 <P> * normalzoom = 0x0 <p> */ private static WindowTwoRecord createWindowTwo() { WindowTwoRecord retval = new WindowTwoRecord(); retval.setOptions(( short ) 0x6b6); retval.setTopRow(( short ) 0); retval.setLeftCol(( short ) 0); retval.setHeaderColor(0x40); retval.setPageBreakZoom(( short ) 0); retval.setNormalZoom(( short ) 0); return retval; }
358359360361362363364365366367
HSSFSheet sheet = new HSSFSheet(workbook); sheets.add(sheet); workbook.setSheetName(sheets.size() - 1, "Sheet" + (sheets.size() - 1)); WindowTwoRecord windowTwo = (WindowTwoRecord) sheet.getSheet().findFirstRecordBySid(WindowTwoRecord.sid); windowTwo.setSelected(sheets.size() == 1); windowTwo.setPaged(sheets.size() == 1); return sheet; }
375376377378379380381382383384385386387
public HSSFSheet cloneSheet(int sheetNum) { HSSFSheet srcSheet = (HSSFSheet)sheets.get(sheetNum); String srcName = workbook.getSheetName(sheetNum); if (srcSheet != null) { HSSFSheet clonedSheet = srcSheet.cloneSheet(workbook); WindowTwoRecord windowTwo = (WindowTwoRecord) clonedSheet.getSheet().findFirstRecordBySid(WindowTwoRecord.sid); windowTwo.setSelected(sheets.size() == 1); windowTwo.setPaged(sheets.size() == 1); sheets.add(clonedSheet); workbook.setSheetName(sheets.size()-1, srcName+"[1]"); return clonedSheet; }
403404405406407408409410411412
601602603604605606607608
5051525354555657585960
*/ public void testSharedFormula() { List records = new ArrayList(); records.add( new FormulaRecord() ); records.add( new SharedFormulaRecord() ); records.add(new WindowTwoRecord()); constructValueRecord(records); Iterator iterator = valueRecord.getIterator(); RecordBase record = (RecordBase) iterator.next(); assertNotNull( "Row contains a value", record );
8283848586878889
formulaRecord.setColumn( (short) 1 ); blankRecord.setRow( 2 ); blankRecord.setColumn( (short) 2 ); records.add( formulaRecord ); records.add( blankRecord ); records.add(new WindowTwoRecord()); return records; }
7475767778798081828384858687
assertTrue( sheet.records.get(pos++) instanceof MergedCellsTable ); assertTrue( sheet.records.get(pos++) instanceof EOFRecord ); } private static Record createWindow2Record() { WindowTwoRecord result = new WindowTwoRecord(); result.setOptions(( short ) 0x6b6); result.setTopRow(( short ) 0); result.setLeftCol(( short ) 0); result.setHeaderColor(0x40); result.setPageBreakZoom(( short ) 0); result.setNormalZoom(( short ) 0); return result; }