如何在高级 PDF 模板上打印保存的搜索与列表中的一个结果?

How to you print one Result on the Advanced PDF Template from a Saved Search vs a list?

我有一个 Inbound Shipment 保存搜索按集装箱列出的物品。我在打印带有数量、描述等的项目列表时没有问题,但是当我添加 "vessel Number" 或 "shipment number" 时,我不需要它在每一行都重复。我更愿意在 PDF 的顶部而不是在每一行显示我通常 "group" 的信息。

我应该注意,当我打印保存的搜索时,我已经将搜索过滤到一个容器,这意味着只有一个 "shipment number" 和一个 "vessel number"。

<table align="center" border=".5" cellpadding=".5" cellspacing=".5" class="NATIVE-TABLE" style="width:100%;"><#list results as result><#if result_index == 0>
<thead>
    <tr>
    <th align="center" scope="col" style="width: 107px;">
    <div><big>Shipment #</big></div>
    </th>
    <th align="center" scope="col" style="width: 103px;">
    <div><big>Status</big></div>
    </th>
    <th align="center" scope="col" style="width: 156px;">
    <div><big>Destination</big></div>
    </th>
    <th align="center" scope="col" style="width: 150px;">
    <div><big>Actual Ship Date</big></div>
    </th>
    <th align="center" scope="col" style="width: 154px;">
    <div><big>Expected Delivery Date</big></div>
    </th>
    <th align="center" scope="col">
    <div><big>Carrier</big></div>
    </th>
    <th align="center" scope="col">
    <div><big>Vessel #</big></div>
    </th>
    </tr>
</thead>
</#if><tr>
    <td align="center" style="width: 107px;">${result.shipmentnumber}</td>
    <td align="center" style="width: 103px;">${result.status}</td>
    <td align="center" style="width: 156px;">${result.custrecord142}</td>
    <td align="center" style="width: 150px;">${result.actualshippingdate}</td>
    <td align="center" style="width: 154px;">${result.expecteddeliverydate}</td>
    <td align="center" style="width: 154px;">${result.custrecord_htd_shipper_info}</td>
    <td align="center" style="width: 154px;">${result.vesselnumber}</td>
    </tr>
    </#list></table>

首先:请 post 您的代码,以便我们了解您的进度并做出相应的回应 - 这有助于我们为您提供帮助!

第二:一般模式是您只需使用第一个结果的值来组成您的 header,然后遍历所有结果以给出您的行。它看起来像:

<#list results as result>
    <#if result_index == 0>
        *header information goes here*
    </#if>
        *line information goes here*
</#list>

编辑添加代码

<table align="center" border=".5" cellpadding=".5" cellspacing=".5" class="NATIVE-TABLE" style="width:100%;"><#list results as result><#if result_index == 0>
    <thead>
        <tr>
        <th align="center" scope="col" style="width: 107px;">
        <div><big>Shipment #</big></div>
        </th>
        <th align="center" scope="col" style="width: 103px;">
        <div><big>Status</big></div>
        </th>
        <th align="center" scope="col" style="width: 156px;">
        <div><big>Destination</big></div>
        </th>
        <th align="center" scope="col" style="width: 150px;">
        <div><big>Actual Ship Date</big></div>
        </th>
        <th align="center" scope="col" style="width: 154px;">
        <div><big>Expected Delivery Date</big></div>
        </th>
        <th align="center" scope="col">
        <div><big>Carrier</big></div>
        </th>
        <th align="center" scope="col">
        <div><big>Vessel #</big></div>
        </th>
        </tr>
    </thead>
    <tr>
        <td align="center" style="width: 107px;">${result.shipmentnumber}</td>
        <td align="center" style="width: 103px;">${result.status}</td>
        <td align="center" style="width: 156px;">${result.custrecord142}</td>
        <td align="center" style="width: 150px;">${result.actualshippingdate}</td>
        <td align="center" style="width: 154px;">${result.expecteddeliverydate}</td>
        <td align="center" style="width: 154px;">${result.custrecord_htd_shipper_info}</td>
        <td align="center" style="width: 154px;">${result.vesselnumber}</td>
        </tr>
    </#if>
        <tr>
        <td align="center" style="width: 107px;"></td>
        <td align="center" style="width: 103px;">${result.status}</td>
        <td align="center" style="width: 156px;">${result.custrecord142}</td>
        <td align="center" style="width: 150px;">${result.actualshippingdate}</td>
        <td align="center" style="width: 154px;">${result.expecteddeliverydate}</td>
        <td align="center" style="width: 154px;">${result.custrecord_htd_shipper_info}</td>
        <td align="center" style="width: 154px;"></td>
        </tr>
    </#list>
</table>