Package io.keikai.range.impl
Class SubtotalHelper
java.lang.Object
io.keikai.range.impl.SubtotalHelper
Helper class that implements the subtotal algorithm:
- Sort data by groupByCol
- Insert subtotal rows at group boundaries
- Insert SUBTOTAL formulas in totalCols
- Add outline grouping
- Add grand total at bottom
- Since:
- 7.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplySubtotal(SSheet sheet, CellRegion range, int groupByCol, SubtotalFunction function, int[] totalCols, boolean replace, boolean pageBreak, boolean summaryBelowData) Applies subtotals to the specified range on the sheet.
-
Method Details
-
applySubtotal
public static void applySubtotal(SSheet sheet, CellRegion range, int groupByCol, SubtotalFunction function, int[] totalCols, boolean replace, boolean pageBreak, boolean summaryBelowData) Applies subtotals to the specified range on the sheet.- Parameters:
sheet- the sheet containing the datarange- the data region (including header row)groupByCol- column index (0-based, relative to range) to group byfunction- the aggregation functiontotalCols- column indices (0-based, relative to range) to apply subtotalsreplace- true to remove existing subtotal rows firstpageBreak- true to insert page breaks between groupssummaryBelowData- true to put subtotal rows below groups
-