Table
To add a table, set the frame element’s type attribute to table as shown in the
following example.
Example of XML Report Definition to Generate Table Type JSON Data
<report>
...
<frame type="table" query-name="MainQuery" name="MainFrame">
<groups>
<group name="grpAllDiscounts">
<group-item name="organizationID" data-type="integer"></group-item>
</group>
<detail>
<detail-item name="discountName" data-type="text"></detail-item>
<detail-item name="discountTotal" data-type="number"></detail-item>
<detail-item name="discountCount" data-type="number"></detail-item>
<detail-item name="AvgDiscount" data-type="number"></detail-item>
<sort-rules>
<sort-rule name="s1">
<sort-field name="discountName" sort-type="ascending"></sort-field>
</sort-rule>
<sort-rule name="s3">
<sort-field name="discountTotal" sort-type="ascending"></sort-field>
<sort-field name="discountName" sort-type="ascending"></sort-field>
</sort-rule>
<sort-rule name="s4">
<sort-field name="discountCount" sort-type="descending"></sort-field>
<sort-field name="discountName" sort-type="ascending"></sort-field>
</sort-rule>
<sort-rule name="s5">
<sort-field name="AvgDiscount" sort-type="descending"></sort-field>
<sort-field name="discountName" sort-type="ascending"></sort-field>
</sort-rule>
</sort-rules>
</detail>
</groups>
<sort-actions default="a3">
<sort-action name="a1">
<sort-action-rule group-name="detail" sort-rule="s1"></sort-action-rule>
</sort-action>
<sort-action name="a3">
<sort-action-rule group-name="detail" sort-rule="s3"></sort-action-rule>
</sort-action>
<sort-action name="a4">
<sort-action-rule group-name="detail" sort-rule="s4"></sort-action-rule>
</sort-action>
<sort-action name="a5">
<sort-action-rule group-name="detail" sort-rule="s5"></sort-action-rule>
</sort-action>
</sort-actions>
<bands>
<band type="table-column-header">
<cell type="text" data-format="text" alignment="left" style="header_1" sort-action="a1">DiscountName</cell>
<cell type="text" data-format="text" alignment="left" style="header_1">DiscountPercentage</cell>
<cell type="text" data-format="text" alignment="right" style="header_1" sort-action="a4">DiscountCount</cell>
<cell type="text" data-format="text" alignment="right" style="header_1" sort-action="a5">AverageAmount</cell>
</band>
<band type="table-body">
<cell type="column" data-format="text" alignment="left" print-width="130" indent-level="6" drilldown="DrillAllChecks">discountName</cell>
<cell type="column" data-format="percent" alignment="right" suppress-zeroes="true" print-width="30" decimal-places="0" name="DiscPercent">posPercent</cell>
<cell type="column" data-format="integer" alignment="right" print-width="80">discountCount</cell>
<cell type="expr" data-format="currency" alignment="right" print-width="80" name="AvgDiscount">discountTotal/discountCount</cell>
</band>
</bands>
</frame>
<layout type="columner">
<component frame-name="MainFrame" column="1" visual-type="ojTable" visual-style="oj-sm-12" visual-title=""/>
</layout>
</report>
Parent topic: Visualizations