use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookView in project poi by apache.
the class XSSFWorkbook method getFirstVisibleTab.
/**
* Gets the first tab that is displayed in the list of tabs in excel.
*
* @return integer that contains the index to the active sheet in this book view.
*/
@Override
public int getFirstVisibleTab() {
CTBookViews bookViews = workbook.getBookViews();
CTBookView bookView = bookViews.getWorkbookViewArray(0);
return (short) bookView.getFirstSheet();
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookView in project poi by apache.
the class XSSFWorkbook method setFirstVisibleTab.
/**
* 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.
*/
@Override
public void setFirstVisibleTab(int index) {
CTBookViews bookViews = workbook.getBookViews();
CTBookView bookView = bookViews.getWorkbookViewArray(0);
bookView.setFirstSheet(index);
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookView in project poi by apache.
the class XSSFWorkbook method onWorkbookCreate.
/**
* 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());
stylesSource.setWorkbook(this);
namedRanges = new ArrayList<XSSFName>();
namedRangesByName = new ArrayListValuedHashMap<String, XSSFName>();
sheets = new ArrayList<XSSFSheet>();
pivotTables = new ArrayList<XSSFPivotTable>();
}
Aggregations