List of usage examples for org.apache.poi.xssf.streaming SXSSFSheet groupRow
@Override public void groupRow(int fromRow, int toRow)
Please note the rows being grouped must be in the current window, if the rows are already flushed then groupRow has no effect.
From source file:poi.xssf.streaming.examples.Outlining.java
License:Apache License
private void collapseRow() throws Exception { SXSSFWorkbook wb2 = new SXSSFWorkbook(100); SXSSFSheet sheet2 = (SXSSFSheet) wb2.createSheet("new sheet"); int rowCount = 20; for (int i = 0; i < rowCount; i++) { sheet2.createRow(i);// w ww.j a va 2 s. c o m } sheet2.groupRow(4, 9); sheet2.groupRow(11, 19); sheet2.setRowGroupCollapsed(4, true); FileOutputStream fileOut = new FileOutputStream("outlining_collapsed.xlsx"); wb2.write(fileOut); fileOut.close(); wb2.dispose(); }