View | Details | Raw Unified | Return to bug 57459
Collapse All | Expand All

(-)src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java (+28 lines)
Lines 1140-1145 Link Here
1140
                ct.addNewSheetFormatPr();
1138
                ct.addNewSheetFormatPr();
1141
        if(outlineLevelRow > 0) pr.setOutlineLevelRow((short)outlineLevelRow);
1139
        if(outlineLevelRow > 0) pr.setOutlineLevelRow((short)outlineLevelRow);
1142
    }
1140
    }
1141
    
1142
    /**
1143
     * Set row groupings (like groupRow) in a stream-friendly manner
1144
     *
1145
     * <p>
1146
     *    groupRows requires all rows in the group to be in the current window.
1147
     *    This is not always practical.  Instead use setRowOutlineLevel to 
1148
     *    explicitly set the group level.  Level 1 is the to level group, 
1149
     *    followed by 2, etc.  It is up to the user to ensure that level 2
1150
     *    groups are correctly nested under level 1, etc.
1151
     * </p>
1152
     *
1153
     * @param rownum    index of row to update (0-based)
1154
     * @param level     outline level (> 0)
1155
     */
1156
    public void setRowOutlineLevel(int rownum, int level)
1157
    {
1158
        SXSSFRow row = _rows.get(new Integer(rownum));
1159
        row.setOutlineLevel(level);
1160
        if(level > 0 && level > outlineLevelRow) {
1161
            outlineLevelRow = level;
1162
            CTWorksheet ct = _sh.getCTWorksheet();
1163
            CTSheetFormatPr pr = ct.isSetSheetFormatPr() ?
1164
                ct.getSheetFormatPr() :
1165
                ct.addNewSheetFormatPr();
1166
            pr.setOutlineLevelRow((short)outlineLevelRow);
1167
        }
1168
    }
1143
1169
1144
    /**
1170
    /**
1145
     * Ungroup a range of rows that were previously groupped
1171
     * Ungroup a range of rows that were previously groupped

Return to bug 57459