Search in sources :

Example 1 with CTBookViews

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookViews 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();
}
Also used : CTBookViews(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookViews) CTBookView(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookView)

Example 2 with CTBookViews

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookViews 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);
}
Also used : CTBookViews(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookViews) CTBookView(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookView)

Example 3 with CTBookViews

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookViews 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>();
}
Also used : CTBookViews(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookViews) POIXMLProperties(org.apache.poi.POIXMLProperties) CTWorkbookPr(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbookPr) CTBookView(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookView)

Aggregations

CTBookView (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookView)3 CTBookViews (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookViews)3 POIXMLProperties (org.apache.poi.POIXMLProperties)1 CTWorkbookPr (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbookPr)1