高级PDF / HTML模板-带过滤器的Netsuite打印(可能吗?)

问题描述 投票:1回答:1

是否可以使用所使用的过滤器打印PDF保存的搜索?

例如:

  Subsidiary A was chosen.

PDF格式可以打印为吗?

    Subsidiary: ${filter.subsidiary}<br />
    Printed By: ${user.firstname} ${user.lastname}  

出来的是:

    Subsidiary: A
    Printed By: Alex Samson  

注:

我不想使用$ {user.subsidiary},因为某些角色有多个子公司,而报表可能只使用一个。

下面是PDF HTML

不知道要在代码本身中编辑什么,因为过滤器位于搜索本身。

<?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" />
    <macrolist>
        <macro id="nlheader">
            <p>Report Name: WRR<br />${field.subsidiary}&nbsp;</p>
        </macro>
        <macro id="nlfooter">
            <p><span style="font-size:11px;">Printed By&nbsp;${user.firstname}&nbsp;${user.lastname}&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp;Printed On: ${.now}&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| <pagenumber/>/<totalpages/></span></p>
        </macro>
    </macrolist>
    <style type="text/css">table { font-size: 9pt; table-layout: fixed;
            border-collapse: collapse;}
      th {  font-weight: bold; font-size: 8pt; vertical-align: middle; padding: 5px 6px 3px; background-color: #e3e3e3; color: #333333; padding-bottom: 10px; padding-top: 10px;
            border: solid;
            border-collapse: collapse;
            word-break: break-all;}
      td {  padding: 4px 4px ;
            border: dashed ;
            border-width: 0.1px;
            border-collapse: collapse;
            }
      b { font-weight: bold; color: #333333; }
</style>
</head>
<body header="nlheader" header-height="15%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.3in 0.3in" size="Legal-LANDSCAPE">
    <table align="left" dir="ltr" style="height:39px;"><#list results as result><#if result_index == 0>
<thead>
    <tr>
    <th style="width: 9px; height: 39px; text-align: left;">${result.mainline@label}</th>
    <th style="width: 74px; height: 39px; text-align: left;">${result.formulatext@label}</th>
    <th style="height: 39px; width: 46px; text-align: left;">${result.custbody_podocunum@label}</th>
    <th style="height: 39px; width: 45px; text-align: left;">${result.trandate@label}</th>
    <th style="height: 39px; width: 53px; text-align: left;">${result.formuladate@label}</th>
    <th style="height: 39px; width: 69px; text-align: left;">WRR No.</th>
    <th style="height: 39px; width: 62px; text-align: left;">WRR Tran No.</th>
    <th style="height: 39px; width: 94px; text-align: left;">${result.item@label}</th>
    <th style="height: 39px; width: 147px; text-align: left;">Description</th>
    <th style="height: 39px; width: 62px; text-align: left;">Amount in Currency</th>
    <th style="height: 39px; width: 82px; text-align: left;">Unit Price</th>
    <th style="height: 39px; width: 54px; text-align: left;">${result.exchangerate@label}</th>
    <th style="height: 39px; width: 63px; text-align: left;">${result.amount@label}</th>
    <th style="height: 39px; width: 80px; text-align: left;">${result.formulanumeric@label}</th>
    <th style="height: 39px; width: 38px; text-align: left;">${result.quantity@label}</th>
    <th style="height: 39px; width: 31px; text-align: left;">WRR Qty</th>
    <th style="height: 39px; width: 37px; text-align: left;">${result.formulanumeric_2@label}</th>
    </tr>
</thead>
</#if><tr>
    <td style="width: 9px;">${result.mainline}</td>
    <td style="width: 74px;">${result.formulatext}</td>
    <td style="width: 46px;">${result.custbody_podocunum}</td>
    <td style="width: 45px;">${result.trandate}</td>
    <td style="width: 53px;">${result.formuladate}</td>
    <td style="width: 69px;">${result.formulatext_1}</td>
    <td style="width: 62px;">${result.formulatext_2}</td>
    <td style="width: 94px;">${result.item}</td>
    <td style="width: 147px;">${result.formulatext_3}</td>
    <td style="width: 62px;">${result.fxamount}</td>
    <td style="width: 82px;">${result.formulatext_4}</td>
    <td style="width: 54px;">${result.exchangerate}</td>
    <td style="width: 63px;">${result.amount}</td>
    <td style="width: 80px;">${result.formulanumeric}</td>
    <td style="width: 38px;">${result.quantity}</td>
    <td style="width: 31px;">${result.formulanumeric_1}</td>
    <td style="width: 37px;">${result.formulanumeric_2}</td>
    </tr>
    </#list></table>
</body>
</pdf> 
javascript html netsuite suitescript2.0
1个回答
0
投票

是的,您可以使用Advance PDF打印要引用的交易或记录的子公司。

$ {field.subsidiary}用于交易或$ {custrecord_subsidiary.name}用于自定义记录

注意:如果您确切地告诉您要尝试打印哪种类型的reocrd,可以更改此代码。

© www.soinside.com 2019 - 2024. All rights reserved.