Package org.adempiere.impexp
Class ExcelSubtotalFunction
java.lang.Object
org.adempiere.impexp.ExcelSubtotalFunction
Excel SUBTOTAL function codes and formula builder shared by the XLS and XLSX exporters.
SUBTOTAL ignores other SUBTOTAL cells within its range, which allows nested group and grand totals.
SUBTOTAL ignores other SUBTOTAL cells within its range, which allows nested group and grand totals.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSUBTOTAL function code for AVERAGEstatic final intSUBTOTAL function code for COUNTA (non-empty count)static final intSUBTOTAL function code for MAXstatic final intSUBTOTAL function code for MINstatic final intSUBTOTAL function code for STDEVP (population standard deviation)static final intSUBTOTAL function code for SUMstatic final intSUBTOTAL function code for VARP (population variance) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetSubtotalFormula(int functionCode, int firstRow, int lastRow, int col) Build SUBTOTAL formula (without the leading =) for a column rangestatic booleanisFunction(int functionCode)
-
Field Details
-
SUM_FUNCTION
public static final int SUM_FUNCTIONSUBTOTAL function code for SUM- See Also:
-
COUNT_FUNCTION
public static final int COUNT_FUNCTIONSUBTOTAL function code for COUNTA (non-empty count)- See Also:
-
MIN_FUNCTION
public static final int MIN_FUNCTIONSUBTOTAL function code for MIN- See Also:
-
MAX_FUNCTION
public static final int MAX_FUNCTIONSUBTOTAL function code for MAX- See Also:
-
VAR_FUNCTION
public static final int VAR_FUNCTIONSUBTOTAL function code for VARP (population variance)- See Also:
-
AVG_FUNCTION
public static final int AVG_FUNCTIONSUBTOTAL function code for AVERAGE- See Also:
-
STDEV_FUNCTION
public static final int STDEV_FUNCTIONSUBTOTAL function code for STDEVP (population standard deviation)- See Also:
-
-
Method Details
-
isFunction
public static boolean isFunction(int functionCode) - Parameters:
functionCode- SUBTOTAL function code- Returns:
- true if functionCode is a valid function code (i.e. cell should be exported as formula)
-
getSubtotalFormula
Build SUBTOTAL formula (without the leading =) for a column range- Parameters:
functionCode- SUBTOTAL function code (SUM_FUNCTION, COUNT_FUNCTION, etc.)firstRow- first row index (0 based) of rangelastRow- last row index (0 based) of rangecol- column index (0 based)- Returns:
- formula, for e.g. SUBTOTAL(9,C2:C10)
-