Menu

XLSX TABLE

Tag library for producing tables into XLSX templates.

Tags of this library may only be used in XLSX document content.

reportTable

Creates a table-like structure presenting the Report data specified with the value attribute. Currently the only source of reports for this tag is the Salesforce-specific loadReport tag.

This tag expects the defined name's area to contain a certain amount of rows depending on the type of the report. If the report is a tabular report, there should be three rows: a header row as the first row, a detail row model as the second row and a grand total row as the third.

If the report is a summary report, the structure differs from the tabular version by there having to as many group row models as the report has grouping levels. The group row models are placed between the header and the detail row model, with the topmost group row model representing the highest grouping level and the group row model just above the detail model the lowest grouping level.

Upon evaluation of this tag, the group and detail row models of the table are multiplied and evaluated to produce the rows needed to present the report data. The grand total row is also evaluated and may therefore contain EL expressions, while the header row is not evaluated. EL expressions within the evaluated rows' cells can access the relevant report data in the variable context through predefined variable names. Each of the variables found in the context represent data values in the report and share certain properties.

As the various rows of data are being produced, the table is likely to expand downwards past the tagged defined name's area. If there is content below the area, it will be shifted downwards as much as the table expands. Should there be any content that would be shifted beyond row 1048576 - the last possible row on an Excel worksheet - that content will be lost.

Common properties

A data value may have three different kinds of representations and can be accessed as follows (with 'var' here being the example name of the variable):

var.orig The original unformatted representation of the value.
var.val or var A template-formatted value. If the document has a default format suited to the type of this value, this representation of the value is basically 'var.orig' formatted as specified by the appropriate tag.
var.pre Value as formatted by the source of the report data. The report data's source may provide a formatted representation of 'var.orig' itself, which may differ from 'var.val'.

Group row

A group row has its data stored in context variable named like 'gr1', 'gr2', etc. depending on the group's level (highest level group has 'gr1'). Using 'gr1' as the example variable, the following group properties are available for tags within the group row:

gr1.lbl Label of the group. For example, if the data is opportunities and grouped by the current stage of the opportunities, the label here could be "Stage".
gr1, gr1.val, gr1.pre, gr1.orig Value of the group, in its different forms as described in the Common properties section. Following on the example of the label, values of groups would be different opportunity stages eg. "Prospecting" and "Negotiation".
gr1.ag A map containing the aggregate column values of this column. Access an aggregate value by the label of its column, eg. ${gr1.ag["Amount"].val}.

Detail row

A detail row has its data stored in context variable 'det'. This variable is a map containing the different detail values with the labels of the detail columns as keys. For example, ${det["Opportunity Name"].val}.

Total row

The total row has its data stored in context variable 'tot'. The total row resembles a group row, but only contains aggregate values. For example, ${tot.ag["Amount"].val}.

This tag produces a local variable context for the expressions within its area.

Attributes

value


Required
Value type
EL-evaluated
Yes
Report data Yes
Defines the report data that the table will present. 
showDetails

Required
Value type
EL-evaluated
No Boolean Yes
Defines if detail rows are to be shown. If the value of this attribute resolves into true or the attribute is undefined, detail rows are produced, otherwise they are not. If the report data represents a summary report and this attribute resolves to false, the tagged table does not have to contain a model for the detail row.

This attribute value has no effect if the report data is of the tabular type. Tabular reports consist only of detail rows, so they are always shown.
test

Required
Value type
EL-evaluated
No Boolean Yes
Defining this attribute makes the table a conditional element. If defined and the resolved value is false, no table is produced. If the resolved value is true, or if the attribute is not defined, the table is produced normally.  

Comments

0 comments