From: Yegor Kozlov Date: Wed, 29 Feb 2012 10:54:50 +0000 (+0000) Subject: follow on to r1295058 X-Git-Tag: REL_3_8_FINAL~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0f0b3b1729a4d4b321661da64c9308a836ba2085;p=poi.git follow on to r1295058 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1295063 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java index 0311ec55fb..afe8612002 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java @@ -1033,6 +1033,37 @@ public class SXSSFSheet implements Sheet, Cloneable /** * Tie a range of rows together so that they can be collapsed or expanded * + *

+ * Please note the rows being grouped must be in the current window, + * if the rows are already flushed then groupRow has no effect. + *

+ *

+ * Correct code: + *


+     *       Workbook wb = new SXSSFWorkbook(100);  // keep 100 rows in memory
+     *       Sheet sh = wb.createSheet();
+     *       for (int rownum = 0; rownum < 1000; rownum++) {
+     *           Row row = sh.createRow(rownum);
+     *           if(rownum == 200)  {
+     *               sh.groupRow(100, 200);
+     *           }
+     *       }
+     *
+     *      
+ *

+ *

+ * Incorrect code: + *


+     *       Workbook wb = new SXSSFWorkbook(100);  // keep 100 rows in memory
+     *       Sheet sh = wb.createSheet();
+     *       for (int rownum = 0; rownum < 1000; rownum++) {
+     *           Row row = sh.createRow(rownum);
+     *       }
+     *       sh.groupRow(100, 200); // the rows in the range [100, 200] are already flushed and groupRows has no effect
+     *
+     *      
+ *

+ * * @param fromRow start row (0-based) * @param toRow end row (0-based) */ @@ -1049,7 +1080,7 @@ public class SXSSFSheet implements Sheet, Cloneable CTSheetFormatPr pr = ct.isSetSheetFormatPr() ? ct.getSheetFormatPr() : ct.addNewSheetFormatPr(); - pr.setOutlineLevelRow((short)outlineLevelRow); + if(outlineLevelRow > 0) pr.setOutlineLevelRow((short)outlineLevelRow); } /**