Example usage for org.apache.poi.ss.usermodel Sheet getFooter

List of usage examples for org.apache.poi.ss.usermodel Sheet getFooter

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel Sheet getFooter.

Prototype

Footer getFooter();

Source Link

Document

Gets the user model for the default document footer.

Note that XSSF offers more kinds of document footers than HSSF does.

Usage

From source file:uk.co.spudsoft.birt.emitters.excel.tests.SimpleTableReportTest.java

License:Open Source License

@Test
public void testRunReport() throws BirtException, IOException {

    InputStream inputStream = runAndRenderReport("SimpleTable.rptdesign", "xlsx");
    assertNotNull(inputStream);//from   w  w  w . j a v a  2 s  .  c om
    try {

        XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
        assertNotNull(workbook);

        assertEquals(1, workbook.getNumberOfSheets());
        assertEquals("Simple Table Report", workbook.getSheetAt(0).getSheetName());

        Sheet sheet = workbook.getSheetAt(0);
        assertEquals(2, firstNullRow(sheet));

        assertEquals("1", sheet.getRow(0).getCell(0).getStringCellValue());
        assertEquals("2", sheet.getRow(1).getCell(0).getStringCellValue());
        assertEquals(3.0, sheet.getRow(0).getCell(1).getNumericCellValue(), 0.001);
        assertEquals(Cell.CELL_TYPE_BLANK, sheet.getRow(1).getCell(1).getCellType());

        assertEquals("Title\nSubtitle", sheet.getHeader().getLeft());
        assertEquals("The Writer", sheet.getFooter().getLeft());
        assertEquals("1", sheet.getFooter().getCenter());
    } finally {
        inputStream.close();
    }
}