I have the following data model:
<SALE_LIST>
<SALE>
<YEAR>2010</YEAR>
<ITEM>100001</ITEM>
<AMOUNT>1,199.00</AMOUNT>
</SALE>
<SALE>
<YEAR>2010</YEAR>
<ITEM>100002</ITEM>
<AMOUNT>1,200.00</AMOUNT>
</SALE>
<SALE>
<YEAR>2012</YEAR>
<ITEM>100001</ITEM>
<AMOUNT>1,899.00</AMOUNT>
</SALE>
<SALE>
<YEAR>2012</YEAR>
<ITEM>100003</ITEM>
<AMOUNT>1,649.00</AMOUNT>
</SALE>
<SALE>
<YEAR>2013</YEAR>
<ITEM>100004</ITEM>
<AMOUNT>2,199.00</AMOUNT>
</SALE>
<SALE>
<YEAR>2013</YEAR>
<ITEM>100005</ITEM>
<AMOUNT>3,199.00</AMOUNT>
</SALE>
</SALE_LIST>
In rtf template, using for-each
to display all YEAR
:
<?for-each:SALE?>
<?YEAR?>
<?end for-each?>
Normally, the result will be displayed vertically, like this:
2010
2010
2012
2012
2013
2013
How to display the result horizontally, like this:
2010
2010
2012
2012
2013
2013