Vishal Chaudhari
03/20/2025, 8:59 AMxml
<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
<head>
<macrolist>
<macro id="nlheader">
<table>
<tr>
<td colspan="1"></td>
<td colspan="2" align="left">Date: ${.vars["currentDate"]}</td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="2" align="left">Order: ${.vars["currentOrder"]}</td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="2" align="left"><pagenumber/> of <totalpages/></td>
</tr>
</table>
</macro>
</macrolist>
</head>
<body header="nlheader" header-height="10%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
<#assign salesOrders = salesOrders?eval />
<#list salesOrders.salesOrders as order>
<#assign currentDate = order.trandate />
<#assign currentOrder = order.tranid />
<!-- Your body content here -->
</#list>
</body>
</pdf>
Celigo AI
03/20/2025, 8:59 AMAI generated answer (using internal Slack threads):Based on the conversations, it seems that you are trying to add dynamic data to the header of an Advanced PDF template using a loop. However, you are facing issues with displaying data specific to each page correctly. In NetSuite's Advanced PDF templates, the header and footer are defined once and then applied to every page. The header and footer are not part of the loop that generates the body of the document, so they don't have access to the variables that are defined within that loop. One workaround could be to use a different approach where you define all the data you need in the header within the body of the document, and then use CSS to position it at the top of the page. However, this might not work perfectly if the amount of data is dynamic and can span across multiple pages. Here is an example of how you can define data in the body and position it at the top of the page:
xml
<body header="nlheader" header-height="10%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
<#assign salesOrders = salesOrders?eval />
<#list salesOrders.salesOrders as order>
<div style="position: absolute; top: 0;">
<#assign currentDate = order.trandate />
<#assign currentOrder = order.tranid />
Date: ${currentDate}, Order: ${currentOrder}
</div>
<!-- Your body content here -->
</#list>
</body>
Please note that this is a workaround and might not work perfectly for all scenarios. It's always a good idea to test thoroughly to ensure it meets your requirements.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
03/20/2025, 9:00 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841694832
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83305186
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816052437
Celigo AI
03/20/2025, 9:00 AM