Search in sources :

Example 6 with CTPageSetup

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

the class TestXSSFPrintSetup method testSetGetHVResolution.

public void testSetGetHVResolution() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setHorizontalDpi(120);
    pSetup.setVerticalDpi(100);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(120, printSetup.getHResolution());
    assertEquals(100, printSetup.getVResolution());
    printSetup.setHResolution((short) 150);
    printSetup.setVResolution((short) 130);
    assertEquals(150, pSetup.getHorizontalDpi());
    assertEquals(130, pSetup.getVerticalDpi());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Example 7 with CTPageSetup

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

the class TestXSSFPrintSetup method testSetGetFitWidthHeight.

public void testSetGetFitWidthHeight() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setFitToWidth(50);
    pSetup.setFitToHeight(99);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(50, printSetup.getFitWidth());
    assertEquals(99, printSetup.getFitHeight());
    printSetup.setFitWidth((short) 66);
    printSetup.setFitHeight((short) 80);
    assertEquals(66, pSetup.getFitToWidth());
    assertEquals(80, pSetup.getFitToHeight());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Example 8 with CTPageSetup

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

the class TestXSSFPrintSetup method testSetGetCopies.

public void testSetGetCopies() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setCopies(9);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(9, printSetup.getCopies());
    printSetup.setCopies((short) 15);
    assertEquals(15, pSetup.getCopies());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Example 9 with CTPageSetup

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

the class TestXSSFPrintSetup method testSetGetNotes.

public void testSetGetNotes() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setCellComments(STCellComments.NONE);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(false, printSetup.getNotes());
    printSetup.setNotes(true);
    assertEquals(PrintCellComments.AS_DISPLAYED.getValue(), pSetup.getCellComments().intValue());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Example 10 with CTPageSetup

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

the class TestXSSFPrintSetup method testSetGetLeftToRight.

public void testSetGetLeftToRight() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setPageOrder(STPageOrder.DOWN_THEN_OVER);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(false, printSetup.getLeftToRight());
    printSetup.setLeftToRight(true);
    assertEquals(PageOrder.OVER_THEN_DOWN.getValue(), pSetup.getPageOrder().intValue());
}
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