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

标签 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},因为某些 Angular 色有多个子公司,而报告可能只使用一个。不确定要编辑什么,因为过滤器位于搜索本身。

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

最佳答案

是的,您可以使用 Advance PDF 打印您要打印的交易或记录的附属信息:

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

关于javascript - 带过滤器的高级 PDF/HTML 模板打印,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60595282/

相关文章:

javascript - 随着 HTML5 范围 slider 的移动连续更改文本框的值

javascript - JQuery旋转前后动画

sql - 如何使用 SQL 语言访问 netsuite 数据

api - 如何在 netsuite 1.0 搜索过滤器上使用子列表项?我尝试执行 item.fieldname 但它导致错误

javascript - 检索旧记录的行项目

javascript - 为什么canvas不会画图?

javascript - 如何防止秒部分显示在 HTML5 时间输入元素上?

javascript - Java从浏览器读取不同body长度的字节流

javascript - 为 DOM 节点提供 Javascript 功能

html - 使用带有 IMG 标签的 Sprite ?