Kevin Baxter
07/13/2023, 4:43 PM<body padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
<table><#list results as result><#if result_index == 0>
<thead>
<tr>
<th>${result.internalId@label}</th>
<th>${result.entityid@label}</th>
<th>${result.altname@label}</th>
</tr>
</thead>
</#if><tr>
<td>${result.internalid}</td>
<td>${result.entityid]}</td>
<td>${result.altname}</td>
</tr>
</#list></table>
</body>
The search is grouped by entityid and uses MIN for alt name.
The result.entityid@label prints fine, but the row values do not.scottvonduhn
07/13/2023, 6:45 PM'LF | Component Needed Template'
, which means that the PDF template would need to reference that as the variable name. I don’t know how the advanced templates work with spaces in the templateName, as I’ve never tried it. I would stick to a simpler templateName, like 'results'
scottvonduhn
07/13/2023, 6:49 PMKevin Baxter
07/13/2023, 6:52 PMscottvonduhn
07/13/2023, 6:52 PMThe search is grouped by entityid and uses MIN for alt name.
The result.entityid@label prints fine, but the row values do not.
scottvonduhn
07/13/2023, 6:52 PMKevin Baxter
07/13/2023, 6:52 PMKevin Baxter
07/13/2023, 6:53 PM<table style="width: 837px;"><#list results as result><#if result_index == 0>
<thead>
<tr>
<th style="width: 369px;">${result.item@label}</th>
<th style="width: 433px;">${result.quantity@label}</th>
</tr>
</thead>
</#if><tr>
<td style="width: 369px;">${result.item.values.value}</td>
<td style="width: 433px;">${result.quantity}</td>
</tr>
</#list></table>
Kevin Baxter
07/13/2023, 6:53 PMKevin Baxter
07/13/2023, 6:53 PMscottvonduhn
07/13/2023, 6:53 PMKevin Baxter
07/13/2023, 6:54 PMscottvonduhn
07/13/2023, 6:57 PMscottvonduhn
07/13/2023, 6:59 PMresult.item.values.value
may not work at all.scottvonduhn
07/13/2023, 7:01 PM${result['GROUP(item)']}
scottvonduhn
07/13/2023, 7:02 PMresult.item
Kevin Baxter
07/13/2023, 7:03 PMKevin Baxter
07/13/2023, 7:03 PMscottvonduhn
07/13/2023, 7:03 PMKevin Baxter
07/13/2023, 7:04 PMscottvonduhn
07/13/2023, 7:07 PM${result?keys}
?scottvonduhn
07/13/2023, 7:08 PMscottvonduhn
07/13/2023, 7:08 PMscottvonduhn
07/13/2023, 7:09 PM<#list result?keys as column>${column}</#list>
Kevin Baxter
07/13/2023, 7:10 PMscottvonduhn
07/13/2023, 7:10 PMKevin Baxter
07/13/2023, 7:10 PMKevin Baxter
07/13/2023, 7:11 PMKevin Baxter
07/13/2023, 7:11 PMscottvonduhn
07/13/2023, 7:12 PMKevin Baxter
07/13/2023, 7:12 PMscottvonduhn
07/13/2023, 7:12 PMscottvonduhn
07/13/2023, 7:13 PMdisplaying grouped result is one of its limitations.
Kevin Baxter
07/13/2023, 7:13 PMKevin Baxter
07/13/2023, 7:13 PMscottvonduhn
07/13/2023, 7:13 PMscottvonduhn
07/13/2023, 7:14 PMscottvonduhn
07/13/2023, 7:28 PMscottvonduhn
07/13/2023, 7:29 PMscottvonduhn
07/13/2023, 7:32 PM<#assign prev_item = results[0].item>
<#assign quantity = 0>
<#list results?sort_by('item') as result>
<#assign item = result.item>
<#assign new_item = (item != prev_item)>
<#if result_index == 0>
<thead>
<tr>
<th>${result.item@label}</th>
<th>${result.quantity@label}</th>
</tr>
</thead>
</#if>
<#if new_section>
<tr>
<td>${prev_item}</td>
<td>${quantity}</td>
</tr>
<#assign quantity = 0>
</#if>
<#assign prev_item = item>
<#assign quantity = quantity + result.quantity?number>
</#list>