Search in sources :

Example 1 with CTPageSetup

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup in project poi by apache.

the class TestXSSFPrintSetup method testSetGetValidSettings.

public void testSetGetValidSettings() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setUsePrinterDefaults(false);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(false, printSetup.getValidSettings());
    printSetup.setValidSettings(true);
    assertEquals(true, pSetup.getUsePrinterDefaults());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Example 2 with CTPageSetup

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup in project poi by apache.

the class TestXSSFPrintSetup method testSetGetUsePage.

public void testSetGetUsePage() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setUseFirstPageNumber(false);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(false, printSetup.getUsePage());
    printSetup.setUsePage(true);
    assertEquals(true, pSetup.getUseFirstPageNumber());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Example 3 with CTPageSetup

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup in project poi by apache.

the class TestXSSFPrintSetup method testSetGetOrientation.

public void testSetGetOrientation() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setOrientation(STOrientation.PORTRAIT);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(PrintOrientation.PORTRAIT, printSetup.getOrientation());
    assertEquals(false, printSetup.getLandscape());
    assertEquals(false, printSetup.getNoOrientation());
    printSetup.setOrientation(PrintOrientation.LANDSCAPE);
    assertEquals(pSetup.getOrientation().intValue(), printSetup.getOrientation().getValue());
    assertEquals(true, printSetup.getLandscape());
    assertEquals(false, printSetup.getNoOrientation());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Example 4 with CTPageSetup

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup in project poi by apache.

the class TestXSSFPrintSetup method testSetGetDraft.

public void testSetGetDraft() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setDraft(false);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(false, printSetup.getDraft());
    printSetup.setDraft(true);
    assertEquals(true, pSetup.getDraft());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Example 5 with CTPageSetup

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup in project poi by apache.

the class TestXSSFPrintSetup method testSetGetNoColor.

public void testSetGetNoColor() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setBlackAndWhite(false);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(false, printSetup.getNoColor());
    printSetup.setNoColor(true);
    assertEquals(true, pSetup.getBlackAndWhite());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Aggregations

CTPageSetup (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)13 CTWorksheet (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet)13