FieldStatistic Tag Use

Used In

HTML Layout Pages and Page Templates within a GEN:Table code generation tag.

Code Generation Tag Attributes

Attribute

Required

Description

Name

Yes

The name of this tag.  This name must be unique within the file and cannot contain spaces.

Type

Yes

The type of this tag.  The only type supported currently is “sum”.  In the future, this tag may support additional types such as “max” or “min”.

Scope

Yes

This attribute specifies the scope of the statistic. The two choices are:

CurrentPage

Displays the page total for all records displayed on the current page.  If only 10 records out of a possible of 100 records are displayed on the current page, the CurrentPage displays the total for the 10 records displayed on the screen.

AllPages

Displays the grand total for all records in the current query.  For example, if an application user filters a table to show only the orders during the month of January, then the AllPages scope will display the total order amount for all January orders – even if these orders are displayed across multiple pages in the table.

Examples

     <GEN:Table Name=”EmployeesTable”>

              <table>
                 <GEN:ItemTemplate>
                   <tr bgcolor=”white”>
                    <td><GEN:FieldValue Name=”FirstName”/></td>
                    <td><GEN:FieldValue Name=”LastName”/></td>
                    <td><GEN:FieldValue Name=”Title”/></td>
                    <td><GEN:FieldValue Name=”Address”/></td>
                    <td><GEN:FieldValue Name=”City”/></td>
                    <td><GEN:FieldValue Name=”State”/></td>
                    <td><GEN:FieldValue Name=”ZipCode”/></td>
                    <td><GEN:FieldValue Name=”Country”/></td>
                    <td><GEN:FieldValue Name=”Phone”/></td>
                   </tr>

                </GEN:ItemTemplate>             

                <!-- table footer -->
                 <GEN:FooterTemplate>
                <tr>

                   <td colspan=1>Page Total</td>

                   <td colspan=10>

                        <GEN:FieldStatistic Name=”PageTotal” Type=”Sum” Scope=”CurrentPage”/>

                   </td>

                </tr>

                <tr>

                   <td colspan=1>Grand Total</td>

                   <td colspan=10>

                        <GEN:FieldStatistic Name=”PageTotal” Type=”Sum” Scope=”AllPages”/>

                   </td>

                </tr>

                 </GEN:FooterTemplate>
             </table>
     </GEN:Table>

See Also

FieldStatistic Tag