Package io.github.dornol.excelkit.excel
Class ExcelSummary
java.lang.Object
io.github.dornol.excelkit.excel.ExcelSummary
Fluent DSL for adding summary (footer) rows with formulas such as SUM, AVERAGE, COUNT, MIN, MAX.
Usage:
writer
.summary(s -> s
.label("Total")
.sum("Amount")
.average("Score"))
.write(data);
- Since:
- 0.7.2
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds an AVERAGE formula for the specified column.Adds a COUNT formula for the specified column.Sets the label text for the summary row(s).Sets the label text for the summary row(s) in a specific column.Adds a MAX formula for the specified column.Adds a MIN formula for the specified column.Adds a SUM formula for the specified column.
-
Constructor Details
-
ExcelSummary
public ExcelSummary()Creates a new summary configuration.
-
-
Method Details
-
label
Sets the label text for the summary row(s). The label is placed in the first column by default.- Parameters:
text- the label text (e.g., "Total", "Summary")- Returns:
- this summary for chaining
-
label
Sets the label text for the summary row(s) in a specific column.- Parameters:
columnName- the column to place the label intext- the label text- Returns:
- this summary for chaining
-
sum
Adds a SUM formula for the specified column.- Parameters:
columnName- the target column name- Returns:
- this summary for chaining
-
average
Adds an AVERAGE formula for the specified column.- Parameters:
columnName- the target column name- Returns:
- this summary for chaining
-
count
Adds a COUNT formula for the specified column.- Parameters:
columnName- the target column name- Returns:
- this summary for chaining
-
min
Adds a MIN formula for the specified column.- Parameters:
columnName- the target column name- Returns:
- this summary for chaining
-
max
Adds a MAX formula for the specified column.- Parameters:
columnName- the target column name- Returns:
- this summary for chaining
-