<#if record.item?has_content>
<table class="itemtable" style="margin-top:10px;width:100%;"><!-- start items --><#list record.item as item><#if item_index==0>
<thead>
<tr>
<th align="left" colspan="9">Product Description</th>
<th align="center" colspan="4">Packaging Type</th>
<th align="center" colspan="3">${item.quantity@label} /<br />Weight (T)</th>
<th align="center" colspan="3">${item.rate@label} (${record.currency})</th>
<th align="right" colspan="4">${item.amount@label} (${record.currency})</th>
</tr>
</thead>
</#if><tr>
<td colspan="9" line-height="150%"><span class="itemname"><!--${item.item}--></span>${item.description}</td>
<td align="center" colspan="4">${item.custcol_mss_bag_type}</td>
<td align="center" colspan="3">${item.quantity}</td>
<td align="center" colspan="3">${item.rate?string['#,##0.00']}</td>
<td align="right" colspan="4">${item.amount?string['#,##0.00']}</td>
</tr>
</#list><!-- end items --></table>
<hr />
This is custom record that pulls line data from different Sales Order.
My issue is many time there are same item that appears on many lines making the printout heavy and repetitive.
I saw this extract online
<#assign item_group = {}/>
<#List record item as item>
<#assign item_key = item.item/>
<#assign item_group = item_group + {item.item: item}>
</#list>
<#list item_group?values as item>
<td align="center" colspan="4">${item.item}</td>
<td align="center" colspan="4">${item.description}</td>
</#list>
But I don’t see how to use it or if it applies to my scenario.
Is there a way to make grouping?