带有过滤器的高级PDF / HTML模板打印

时间:2020-03-09 05:47:32

标签: javascript html netsuite suitescript2.0

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

Subsidiary A was chosen.

可以打印PDF表格吗?

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

哪个出现:

Subsidiary: A
Printed By: Alex Samson  

我不想使用${user.subsidiary},因为某些角色有多个子公司,而报告可能只使用一个。由于筛选器位于搜索本身,因此不确定要编辑的内容。

<?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>

1 个答案:

答案 0 :(得分:0)

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

${field.subsidiary} for transactions or ${custrecord_subsidiary.name} for custom record