https://bz.apache.org/bugzilla/show_bug.cgi?id=58077

--- Comment #5 from albfan <albertofan...@gmail.com> ---
        public static final int ROWS=1000;
        public static final int WINDOW_SIZE=100;
        //public static final int WINDOW_SIZE=1000;

        public static void main(String args[]) throws FileNotFoundException,
IOException{
                File outputFile = new File("testFile-actual.xlsx");
                SXSSFWorkbook sworkbook = new SXSSFWorkbook(WINDOW_SIZE);
                creatXLSX(outputFile, sworkbook);

                File expectedoutputFile = new File("testFile-expected.xlsx");
                XSSFWorkbook workbook = new XSSFWorkbook();
                creatXLSX(expectedoutputFile, workbook);
        }

        private static void creatXLSX(File outputFile, Workbook workbook)
                throws IOException, FileNotFoundException {
                Sheet sheet = workbook.createSheet();
                int posFirstRow = 1;
                boolean addgroup = true;
                for(int i = 0; i < ROWS; i++) {
                        Row row = sheet.createRow(i);
                        Cell cell = row.createCell(0);
                        cell.setCellValue(i);
                        if (addgroup && i % WINDOW_SIZE == 0) {
                                sheet.groupRow(posFirstRow, i);
                                posFirstRow = i+1;
                        }
                        if (i == 556) {
                                sheet.groupRow(posFirstRow, 553);
                                posFirstRow = 556;
                                addgroup = false;
                        }
                }
                workbook.write(new FileOutputStream(outputFile));
        }

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to