Example usage for org.apache.poi.xssf.usermodel XSSFWorkbook getNumberOfSheets

List of usage examples for org.apache.poi.xssf.usermodel XSSFWorkbook getNumberOfSheets

Introduction

In this page you can find the example usage for org.apache.poi.xssf.usermodel XSSFWorkbook getNumberOfSheets.

Prototype

@Override
public int getNumberOfSheets() 

Source Link

Document

Get the number of worksheets in the this workbook

Usage

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

License:Open Source License

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

    removeEmptyRows = false;//from  w w  w.  j a v a2s.co m
    InputStream inputStream = runAndRenderReport("Borders3.rptdesign", "xlsx");
    assertNotNull(inputStream);
    try {

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

        assertEquals(1, workbook.getNumberOfSheets());
        assertEquals("Borders Test Report 3", workbook.getSheetAt(0).getSheetName());

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

        Borders2ReportTest.assertBorder(sheet, 0, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 0, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 0, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 0, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 0, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 0, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 0, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 0, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 1, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 1, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 1, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 1, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 1, 4, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 1, 5, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 1, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 1, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 2, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 2, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 2, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 2, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 2, 4, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 2, 5, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 2, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 2, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 3, 0, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 3, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 3, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 3, 3, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 3, 4, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 3, 5, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 3, 6, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 3, 7, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 4, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 4, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 4, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 4, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 4, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 4, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 4, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 4, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 5, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 5, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 5, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 5, 3, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 5, 4, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 5, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 5, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 5, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 6, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 6, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 6, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 6, 3, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 6, 4, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 6, 5, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 6, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 6, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 7, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 7, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 7, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 7, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 7, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 7, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 7, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 7, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 8, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 8, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 8, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 8, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 8, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 8, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 8, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 8, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 9, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 9, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 9, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 9, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 9, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 9, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 9, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 9, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 10, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 10, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 10, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 10, 3, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 10, 4, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 10, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 10, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 10, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 11, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 11, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 11, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 11, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 11, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 11, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 11, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 11, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 12, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 12, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 12, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 12, 3, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 12, 4, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 12, 5, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 12, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 12, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 13, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 13, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 13, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 13, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 13, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 13, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 13, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 13, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 14, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 14, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 14, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 14, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 14, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 14, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 14, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 14, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 15, 0, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 15, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 15, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 15, 3, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 15, 4, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 15, 5, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 15, 6, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 15, 7, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 16, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 16, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 16, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 16, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 16, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 16, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 16, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 16, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 17, 0, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 17, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 17, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 17, 3, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 17, 4, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 17, 5, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 17, 6, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 17, 7, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 18, 0, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 18, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 18, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 18, 3, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 18, 4, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 18, 5, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 18, 6, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 18, 7, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 19, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 19, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 19, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 19, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 19, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 19, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 19, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 19, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 20, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 20, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 20, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 20, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 20, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 20, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 20, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 20, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 21, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 21, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 21, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 21, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 21, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 21, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 21, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 21, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 22, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 22, 1, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 22, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 22, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 22, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 22, 5, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 22, 6, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 22, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 23, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 23, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 23, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 23, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 23, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 23, 5, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 23, 6, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 23, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 24, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 24, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 24, 2, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 24, 3, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 24, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 24, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 24, 6, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 24, 7, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 25, 0, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM);
        Borders2ReportTest.assertBorder(sheet, 25, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 25, 2, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 25, 3, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 25, 4, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 25, 5, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 25, 6, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_MEDIUM,
                CellStyle.BORDER_NONE, CellStyle.BORDER_NONE);
        Borders2ReportTest.assertBorder(sheet, 25, 7, CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE,
                CellStyle.BORDER_MEDIUM, CellStyle.BORDER_NONE);

    } finally {
        inputStream.close();
    }
}

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

License:Open Source License

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

    removeEmptyRows = false;//from ww w.  j  a v  a2 s .co m
    InputStream inputStream = runAndRenderReport("Borders4.rptdesign", "xlsx");
    assertNotNull(inputStream);
    try {

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

        assertEquals(2, workbook.getNumberOfSheets());

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

        assertBorder(sheet, 0, 0, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE);

        assertBorder(sheet, 0, 1, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE, CellStyle.BORDER_NONE,
                CellStyle.BORDER_NONE);

    } finally {
        inputStream.close();
    }
}

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

License:Open Source License

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

    InputStream inputStream = runAndRenderReport("CurrencyFormats.rptdesign", "xlsx");
    assertNotNull(inputStream);/* w  w w  .  java  2 s  . c  o m*/
    try {

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

        assertEquals(1, workbook.getNumberOfSheets());
        assertEquals("Currency Formats Test Report", workbook.getSheetAt(0).getSheetName());

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

        DataFormatter formatter = new DataFormatter();

        assertEquals("3141.59", formatter.formatCellValue(sheet.getRow(1).getCell(1)));
        assertEquals("$3141.59", formatter.formatCellValue(sheet.getRow(2).getCell(1)));
        assertEquals("3141.59", formatter.formatCellValue(sheet.getRow(3).getCell(1)));
        assertEquals("3141.59", formatter.formatCellValue(sheet.getRow(4).getCell(1)));
    } finally {
        inputStream.close();
    }
}

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

License:Open Source License

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

    InputStream inputStream = runAndRenderReport("Fonts.rptdesign", "xlsx");
    assertNotNull(inputStream);/*from   w ww .  j  ava2  s . c  om*/
    try {

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

        assertEquals(1, workbook.getNumberOfSheets());
        assertEquals("Fonts Test Report", workbook.getSheetAt(0).getSheetName());

        Sheet sheet = workbook.getSheetAt(0);
        assertNotNull(sheet.getRow(0));
        assertNotNull(sheet.getRow(1));
        assertNotNull(sheet.getRow(2));
        assertNotNull(sheet.getRow(3));
        assertNotNull(sheet.getRow(4));
        assertNotNull(sheet.getRow(5));
        assertNull(sheet.getRow(6));

        assertFontCell(sheet, 0, 0, "Sans Serif 10pt", "Arial", 10);
        assertFontCell(sheet, 1, 0, "Sans Serif 10pt Underlined", "Arial", 10);
        assertFontCell(sheet, 2, 0, "Serif 10pt", "Times New Roman", 10);
        assertFontCell(sheet, 3, 0, "Tahoma Medium", "Tahoma", 12);
        assertFontCell(sheet, 4, 0, "Comic Sans MS X Small", "Comic Sans MS", 8);
        assertFontCell(sheet, 5, 0, "Verdana XX Large", "Verdana", 20);

    } finally {
        inputStream.close();
    }
}

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

License:Open Source License

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

    InputStream inputStream = runAndRenderReport("GappyData.rptdesign", "xlsx");
    assertNotNull(inputStream);/*  w w  w .j av a  2s. c  om*/
    try {

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

        assertEquals(2, workbook.getNumberOfSheets());
        assertEquals("Summary", workbook.getSheetAt(0).getSheetName());
        assertEquals("Data", workbook.getSheetAt(1).getSheetName());

        Sheet summary = workbook.getSheetAt(0);

        assertEquals(5522, summary.getColumnWidth(0));
        assertEquals(1353, summary.getColumnWidth(1));
        assertEquals(529, summary.getColumnWidth(2));
        assertEquals(773, summary.getColumnWidth(3));
        assertEquals(773, summary.getColumnWidth(4));
        assertEquals(0, summary.getColumnWidth(5));
        assertEquals(0, summary.getColumnWidth(6));
        assertEquals(3437, summary.getColumnWidth(7));
        assertEquals(3437, summary.getColumnWidth(8));
        assertEquals(3437, summary.getColumnWidth(9));
        assertEquals(3437, summary.getColumnWidth(10));
        assertEquals(3437, summary.getColumnWidth(11));

        Sheet data = workbook.getSheetAt(1);

        assertEquals(4460, data.getColumnWidth(0));
        assertEquals(1353, data.getColumnWidth(1));
        assertEquals(538, data.getColumnWidth(2));
        assertEquals(773, data.getColumnWidth(3));
        assertEquals(773, data.getColumnWidth(4));
        assertEquals(0, data.getColumnWidth(5));
        assertEquals(0, data.getColumnWidth(6));
        assertEquals(2048, data.getColumnWidth(7));
        assertEquals(2048, data.getColumnWidth(8));
        assertEquals(2048, data.getColumnWidth(9));
        assertEquals(2048, data.getColumnWidth(10));
        assertEquals(2048, data.getColumnWidth(11));

    } finally {
        inputStream.close();
    }
}

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

License:Open Source License

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

    InputStream inputStream = runAndRenderReport("CombinedGrid.rptdesign", "xlsx");
    assertNotNull(inputStream);/*from  ww  w  .jav  a 2  s.  c om*/
    try {

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

        assertEquals(1, workbook.getNumberOfSheets());
        assertEquals("Combined Grid Report", workbook.getSheetAt(0).getSheetName());

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

        DataFormatter formatter = new DataFormatter();

        assertEquals(
                "This is a label\nHeading 1\nThis is text\nHeading 2\nStyles\nBold, Italic, Bold and italic and finally Underline.\n Oh\n Dear\nIsle of Mann\nPlain text.\nAnd this is a label",
                formatter.formatCellValue(sheet.getRow(0).getCell(1)));
        assertEquals(CellStyle.ALIGN_GENERAL, sheet.getRow(0).getCell(1).getCellStyle().getAlignment());
        assertEquals(14, sheet.getRow(0).getCell(1).getRichStringCellValue().numFormattingRuns());
        assertEquals("Hello", formatter.formatCellValue(sheet.getRow(1).getCell(0)));
        assertEquals("End", formatter.formatCellValue(sheet.getRow(2).getCell(0)));

    } finally {
        inputStream.close();
    }
}

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

License:Open Source License

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

    InputStream inputStream = runAndRenderReport("Grouping.rptdesign", "xlsx");
    assertNotNull(inputStream);//  w w  w . jav a  2s  . c  o m
    try {

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

        assertEquals(3, workbook.getNumberOfSheets());

        XSSFSheet sheet0 = workbook.getSheetAt(0);
        XSSFSheet sheet1 = workbook.getSheetAt(1);
        XSSFSheet sheet2 = workbook.getSheetAt(2);
        assertEquals("HeaderAndFooter", sheet0.getSheetName());

        int rowNum0 = 1;
        int rowNum1 = 1;
        int rowNum2 = 1;
        for (int i = 1; i < 9; ++i) {
            System.out.println("i==" + i);
            assertEquals("rowNum=" + rowNum0, 0, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum1, 0, sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum2, 1, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
            for (int j = 0; j < i; ++j) {
                assertEquals("rowNum=" + rowNum0, 1, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
                if (j < i - 1) {
                    assertEquals("rowNum=" + rowNum1, i == 1 ? 0 : 1,
                            sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
                    assertEquals("rowNum=" + rowNum2, i == 1 ? 0 : 1,
                            sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
                }
            }
            assertEquals("rowNum=" + rowNum0, 1, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum1, 1, sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum2, 0, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
        }
        assertTrue(rowNum0 > 50);
        assertTrue(rowNum1 > 40);
        assertTrue(rowNum2 > 40);

    } finally {
        inputStream.close();
    }
}

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

License:Open Source License

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

    disableGrouping = Boolean.TRUE;
    InputStream inputStream = runAndRenderReport("Grouping.rptdesign", "xlsx");
    disableGrouping = null;/*from www  . j a  v  a  2s.c o m*/
    assertNotNull(inputStream);
    try {

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

        assertEquals(3, workbook.getNumberOfSheets());

        XSSFSheet sheet0 = workbook.getSheetAt(0);
        XSSFSheet sheet1 = workbook.getSheetAt(1);
        XSSFSheet sheet2 = workbook.getSheetAt(2);
        assertEquals("HeaderAndFooter", sheet0.getSheetName());

        int rowNum0 = 1;
        int rowNum1 = 1;
        int rowNum2 = 1;
        for (int i = 1; i < 9; ++i) {
            System.out.println("i==" + i);
            assertEquals("rowNum=" + rowNum0, 0, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum1, 0, sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum2, 0, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
            for (int j = 0; j < i; ++j) {
                assertEquals("rowNum=" + rowNum0, 0, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
                if (j < i - 1) {
                    assertEquals("rowNum=" + rowNum1, 0, sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
                    assertEquals("rowNum=" + rowNum2, 0, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
                }
            }
            assertEquals("rowNum=" + rowNum0, 0, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum1, 0, sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum2, 0, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
        }
        assertTrue(rowNum0 > 50);
        assertTrue(rowNum1 > 40);
        assertTrue(rowNum2 > 40);

    } finally {
        inputStream.close();
    }
}

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

License:Open Source License

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

    InputStream inputStream = runAndRenderReport("GroupingDisabledAtReport.rptdesign", "xlsx");
    assertNotNull(inputStream);/*  w  w  w  .j  a  v a2s.c o m*/
    try {

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

        assertEquals(3, workbook.getNumberOfSheets());

        XSSFSheet sheet0 = workbook.getSheetAt(0);
        XSSFSheet sheet1 = workbook.getSheetAt(1);
        XSSFSheet sheet2 = workbook.getSheetAt(2);
        assertEquals("HeaderAndFooter", sheet0.getSheetName());

        int rowNum0 = 1;
        int rowNum1 = 1;
        int rowNum2 = 1;
        for (int i = 1; i < 9; ++i) {
            System.out.println("i==" + i);
            assertEquals("rowNum=" + rowNum0, 0, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum1, 0, sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum2, 0, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
            for (int j = 0; j < i; ++j) {
                assertEquals("rowNum=" + rowNum0, 0, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
                if (j < i - 1) {
                    assertEquals("rowNum=" + rowNum1, 0, sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
                    assertEquals("rowNum=" + rowNum2, 0, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
                }
            }
            assertEquals("rowNum=" + rowNum0, 0, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum1, 0, sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum2, 0, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
        }
        assertTrue(rowNum0 > 50);
        assertTrue(rowNum1 > 40);
        assertTrue(rowNum2 > 40);

    } finally {
        inputStream.close();
    }
}

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

License:Open Source License

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

    InputStream inputStream = runAndRenderReport("GroupingDisabledAtTable.rptdesign", "xlsx");
    assertNotNull(inputStream);/*from  w  ww  . j a  v a 2s  .  com*/
    try {

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

        assertEquals(3, workbook.getNumberOfSheets());

        XSSFSheet sheet0 = workbook.getSheetAt(0);
        XSSFSheet sheet1 = workbook.getSheetAt(1);
        XSSFSheet sheet2 = workbook.getSheetAt(2);
        assertEquals("HeaderAndFooter", sheet0.getSheetName());

        int rowNum0 = 1;
        int rowNum1 = 1;
        int rowNum2 = 1;
        for (int i = 1; i < 9; ++i) {
            System.out.println("i==" + i);
            assertEquals("rowNum=" + rowNum0, 0, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum1, 1, sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum2, 0, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
            for (int j = 0; j < i; ++j) {
                assertEquals("rowNum=" + rowNum0, 0, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
                if (j < i - 1) {
                    assertEquals("rowNum=" + rowNum1, i == 1 ? 0 : 1,
                            sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
                    assertEquals("rowNum=" + rowNum2, 0, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
                }
            }
            assertEquals("rowNum=" + rowNum0, 0, sheet0.getRow(rowNum0++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum1, 0, sheet1.getRow(rowNum1++).getCTRow().getOutlineLevel());
            assertEquals("rowNum=" + rowNum2, 0, sheet2.getRow(rowNum2++).getCTRow().getOutlineLevel());
        }
        assertTrue(rowNum0 > 50);
        assertTrue(rowNum1 > 40);
        assertTrue(rowNum2 > 40);

    } finally {
        inputStream.close();
    }
}