Format Example

This example shows you how the rowcount, visiblerowcount and other vipers can be used inside formatting.

Smartsite SXML CopyCode image Copy Code
<se:xmldatatable save="games" resulttype="datatable">
    <se:row><se:col name="name">Aztec Challenge</se:col></se:row>
    <se:row><se:col>Boulderdash</se:col></se:row>
    <se:row><se:col>California Games</se:col></se:row>
    <se:row><se:col>Defender of the Crown</se:col></se:row>
    <se:row><se:col>Enduro Racer</se:col></se:row>
    <se:row><se:col>Frogger</se:col></se:row>
    <se:row><se:col>Giana Sisters</se:col></se:row>
    <se:row><se:col>Henry's House</se:col></se:row>
    <se:row><se:col>International Karate</se:col></se:row>
    <se:row><se:col>James Bond</se:col></se:row>
    <se:row><se:col>Kik-Start</se:col></se:row>
    <se:row><se:col>Le Mans</se:col></se:row>
    <se:row><se:col>Microprose Soccer</se:col></se:row>
    <se:row><se:col>Nautilus</se:col></se:row>
    <se:row><se:col>Outrun</se:col></se:row>
    <se:row><se:col>Paperboy</se:col></se:row>
    <se:row><se:col>Q-Bert</se:col></se:row>
    <se:row><se:col>Road Runner</se:col></se:row>
    <se:row><se:col>Summer Games</se:col></se:row>
    <se:row><se:col>Test Drive</se:col></se:row>
    <se:row><se:col>Ultra-Smash</se:col></se:row>
    <se:row><se:col>Vegas Jackpot</se:col></se:row>
    <se:row><se:col>Where In The World Is Carmen Sandiego</se:col></se:row>
    <se:row><se:col>Xyron</se:col></se:row>
    <se:row><se:col>Yathzee</se:col></se:row>
    <se:row><se:col>Zak Mckracken And The Alien Mindbenders</se:col></se:row>
</se:xmldatatable>

<se:format inputdata="games" skiprows="6" maxrows="14">
    <se:rowformat trim="right" match="odd">
        {this.visiblerownumber()}. {this.field(name)} (rownr={sys.eval(this.rownumber() + this.skiprows())})<br />
    </se:rowformat>
    
    <se:resultformat>
        {this.result()}
        <hr />
        Displayed {this.visiblerowcount()} rows of {this.rowcount()} in total.
    </se:resultformat>
</se:format>
Example Result CopyCode image Copy Code
1. Giana Sisters (rownr=7)<br />
        2. International Karate (rownr=9)<br />
        3. Kik-Start (rownr=11)<br />
        4. Microprose Soccer (rownr=13)<br />
        5. Outrun (rownr=15)<br />
        6. Q-Bert (rownr=17)<br />
        7. Summer Games (rownr=19)<br />
        <hr />
        Displayed 7 rows of 26 in total.