Matthew
11/30/2023, 5:20 PM<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
<head>
<link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
<#if .locale == "zh_CN">
<link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
<#elseif .locale == "zh_TW">
<link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" />
<#elseif .locale == "ja_JP">
<link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" />
<#elseif .locale == "ko_KR">
<link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" />
<#elseif .locale == "th_TH">
<link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" />
</#if>
<style type="text/css">
body{ height:100%; margin: 0; padding: 0; }
html { height: 100%; margin: 0; padding: 0;}
</style>
</head>
<body padding="1in 0.45in 0.5in 0.75in" size="Letter"> <!-- Padding top right bottom left -->
<#list results?chunk(4) as page>
<#list page as result>
<table border="1" margin-right="0.2in" cellpadding="1" cellspacing="10" style=" height:4.5in; width:3.5in;" float="left">
<tr><td align="right">
<barcode bar-width="1" codetype="code128" showtext="true" value="${result.custcol_gsaitemreqnumber}XXX" />
</td></tr>
<#if result.custitem90?has_content>
<tr><td align="right">
<barcode bar-width="1" codetype="code128" showtext="true" value="${result.custitem90}" />
</td></tr>
<#else>
<tr><td align="right">
<barcode bar-width="1" codetype="code128" showtext="true" value="${result.itemid}" />
</td></tr>
</#if>
<tr><td align="right">
Cartridge, Toner ${result.manufacturer}
</td></tr>
<tr><td align="right">
${result.displayname}
</td></tr>
<tr><td align="right">
${result.quantity}: Each
</td></tr>
<tr><td align="right">
Cage Code: 0G4A2
</td></tr>
<tr><td align="right">
Contract Number: ${result.pricelevel}
</td></tr>
</table>
</#list>
<pbr />
</#list>
</body>
</pdf>
David B
12/01/2023, 1:04 AM<#assign qtycount = 0>
<#list results as result>
<#list 1..result.quantity>
<#assign qtycount++>
<#-- do actual printing of result content here -->
<#if qtycount % 4 == 0>
<pbr> <#-- page break -->
</#if>
</#list>
</#list>
Matthew
12/01/2023, 7:36 PMDavid B
12/08/2023, 2:51 AM<#list 1..result.quantity as i>
You can read about it in the freemarker docs: list, else, items, sep, break, continue - Apache FreeMarker Manual
Basically in freemarker the notation x..y
is shorthand for creating a sequence of integers between x and y (inclusive).
so <#list 1..5 as i>${i}</#list>
would print 12345
you can also do this in reverse (so 5..1
would output 54321
)David B
12/08/2023, 2:51 AM<#list 1..result.quantity as i>
?