|
|
|
Samples SamplesXml Code Config API Docs Download Neolectric |
|
LoopsLets get a set of records to print. This will create a row, col matrix of Strings.<dxp:DbAction value="query" dbcon="demo" store="bids"> <dxp:Cp name="stmt">select id, email, item, biddate, amount from auction</dxp:Cp> </dxp:DbAction> Print all rows of the matrix and specify how each col should be displayed
<table border="0">
<dxp:LoopMatrix value="${bids}" cols="0,1,2,3,4"> <!-- store col values -->
<tr bgcolor="#ccccff">
<td>${0}</td>
<td>${1}</td>
<td>${2}</td>
<td align="right">${3}</td>
<td align="right">${4}</td>
</tr>
</dxp:LoopMatrix>
</table>
Pass each row to a LoopArray and tell it to print all cols
<table border="0">
<dxp:LoopMatrix value="${bids}" cols="row"> <!-- store array of values -->
<tr bgcolor="#ccffcc">
<dxp:LoopArray value="${row}" cols="n"><td>${n}</td></dxp:LoopArray>
</tr>
</dxp:LoopMatrix>
</table>
Note: this loses the ability to customize the display format of each col separately. Printing a subset of rows - offset is the row index to start at, count is the nuber to print
<table border="0">
<dxp:LoopMatrix value="${bids}" cols="0,1,2,3,4" offset="3" count="2">
<tr bgcolor="#ffcccc">
<td>${0}</td>
<td>${1}</td>
<td>${2}</td>
<td align="right">${3}</td>
<td align="right">${4}</td>
</tr>
</dxp:LoopMatrix>
</table>
Note: offset represents the row index which is 1 less than the row number displayed. |