struct Tablo::Summary::BodyRow
- Tablo::Summary::BodyRow
- Struct
- Value
- Object
Overview
The Summary::BodyRow
struct lets you define body rows content
Defined in:
summary.crConstructors
-
.new(column : LabelType, row : Int32, content : CellType | Proc(CellType))
The constructor expects 3 mandatory parameters.
Constructor Detail
The constructor expects 3 mandatory parameters.
-
column : The column identifier
-
row : The row number (ie the relative position)
-
content : A CellType or a Proc returning a
CellType
column and row define the precise location of the aggregated value in the Summary table. Row numbers need not be contiguous; what's important is that they allow results to be displayed in the desired row order.
Example of content directly fed by a literal string:
Tablo::Summary::BodyRow.new("Price", 40, "Tax (20%)")
Tablo::Summary::BodyRow.new("Price", 60, "Balance due")
Example of content fed by a proc returning a CellType
value:
Tablo::Summary::BodyRow.new(:total, 40, -> { Tablo::Summary.use(:tax) })
Tablo::Summary::BodyRow.new(:total, 60, -> { Tablo::Summary.use(:total_due) })
Important:
Note here the use of the Summary.use
class method, which retrieves, via
a Symbol key, an aggregated value previously calculated in
a Summary::UserProc
instance.