/** * Convenience method to set the active sheet. The active sheet is is the sheet * which is currently displayed when the workbook is viewed in Excel. * 'Selected' sheet(s) is a distinct concept. */ @Override public void setActiveSheet(int index) { validateSheetIndex(index); for (CTBookView arrayBook : workbook.getBookViews().getWorkbookViewArray()) { arrayBook.setActiveTab(index); } }
private void setBookViewsIfMissing() { if(!workbook.isSetBookViews()) { CTBookViews bvs = workbook.addNewBookViews(); CTBookView bv = bvs.addNewWorkbookView(); bv.setActiveTab(0); } }
/** * Sets the first tab that is displayed in the list of tabs in excel. * * @param index integer that contains the index to the active sheet in this book view. */ public void setFirstVisibleTab(int index) { CTBookViews bookViews = workbook.getBookViews(); CTBookView bookView= bookViews.getWorkbookViewArray(0); bookView.setActiveTab(index); }
/** * Convenience method to set the active sheet. The active sheet is is the sheet * which is currently displayed when the workbook is viewed in Excel. * 'Selected' sheet(s) is a distinct concept. */ @Override public void setActiveSheet(int index) { validateSheetIndex(index); for (CTBookView arrayBook : workbook.getBookViews().getWorkbookViewArray()) { arrayBook.setActiveTab(index); } }
/** * Convenience method to set the active sheet. The active sheet is is the sheet * which is currently displayed when the workbook is viewed in Excel. * 'Selected' sheet(s) is a distinct concept. */ @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support public void setActiveSheet(int index) { validateSheetIndex(index); for (CTBookView arrayBook : workbook.getBookViews().getWorkbookViewArray()) { arrayBook.setActiveTab(index); } }
private void setBookViewsIfMissing() { if(!workbook.isSetBookViews()) { CTBookViews bvs = workbook.addNewBookViews(); CTBookView bv = bvs.addNewWorkbookView(); bv.setActiveTab(0); } }
/** * Create a new CTWorkbook with all values set to default */ private void onWorkbookCreate() { workbook = CTWorkbook.Factory.newInstance(); // don't EVER use the 1904 date system CTWorkbookPr workbookPr = workbook.addNewWorkbookPr(); workbookPr.setDate1904(false); CTBookViews bvs = workbook.addNewBookViews(); CTBookView bv = bvs.addNewWorkbookView(); bv.setActiveTab(0); workbook.addNewSheets(); POIXMLProperties.ExtendedProperties expProps = getProperties().getExtendedProperties(); expProps.getUnderlyingProperties().setApplication(DOCUMENT_CREATOR); sharedStringSource = (SharedStringsTable)createRelationship(XSSFRelation.SHARED_STRINGS, XSSFFactory.getInstance()); stylesSource = (StylesTable)createRelationship(XSSFRelation.STYLES, XSSFFactory.getInstance()); namedRanges = new ArrayList<XSSFName>(); sheets = new ArrayList<XSSFSheet>(); }