Advanced Row Formatting - GroupFormat

Release 1.0 - ...

Formatting allows you to group data by a column. Multiple rows are grouped by the value of the expression in the groupformat groupby attribute. The rowformat is applied to every row. When the formatting detect a new value in the result of the groupby expression, the rows of the previous group are combined and the groupformat is applied to these rows. Multiple groupformat elements may be specified by using the match and expression attribute on them. The groupby attribute must be defined at least once on any of the groupformat elements. If it is defined more than once it should always contain exactly the same viper expression.

Example:

Smartsite SXML CopyCode image Copy Code
<se:xmldatatable>
    <se:parameters>
        <se:parameter name="xml">
            <se:row><se:col name="Name">Abraham</se:col><se:col name="Phone">555-1423</se:col></se:row>
            <se:row><se:col>Anna</se:col><se:col>555-7485</se:col></se:row>
            <se:row><se:col>Berta</se:col><se:col>555-6349</se:col></se:row>
            <se:row><se:col>Brutus</se:col><se:col>555-4234</se:col></se:row>
        </se:parameter>
        <se:parameter name="format">
 
            <se:groupformat groupby="string.toupper(string.substring(this.field(Name), 0, 1))">
                <h3>Names starting with an '{this.group()}'</h3>
                <ul>
                    {this.groupresult()}
                </ul>
            </se:groupformat>
 
            <se:rowformat>
                <li>
                    {this.field(Name)} : {this.field(Phone)}
                </li>
            </se:rowformat>
 
        </se:parameter>
    </se:parameters>
</se:xmldatatable>