0

SuiteBuilder Customization Guide的第 176/177 页,Oracle 解释了如何向模板中的表添加分页符。

给出的例子是:

<!-- start of item table in transaction -->
<#list record.item as item>
    <#if item_index==0> <!-- Header Definition -->
        <tr>
            <th>${item.field1@label}</th>
            <th>${item.long_text_field@label}</th>
            <th>${item.field2@label}</th>
            <!-- ... -->
        </tr>
    </#if>
    <#list item.long_text_field?split("<br />") as paragraph>
        <#if desc_index==0>
            <tr>
                <td>${item.field1}</td>
                <td>${paragraph}</td>
                <td>${item.field2}</td>
                <!-- ... -->
            </tr>
        <#else>
            <tr>
                <td></td>
                <td>${paragraph}</td>
                <td></td>
                <!-- ... -->
            </tr>
        </#if>
    </#list>
</#list>
<!-- end of item table in transaction -->

但是,这会导致以下错误:

在此处输入图像描述

似乎desc_index无法评估该术语,此外,该术语不会出现在除此处之外的任何其他 NETSuite 相关文档中。

这是错误/错字/已弃用的代码吗?

4

2 回答 2

2

这是示例中的错字。

Freemarker 中的列表索引通过将列表名称与“_index”连接来引用。因此,在此示例中,desc_index应替换为paragraph_index.

似乎他们从另一个列表名称为“desc”(可能是“description”)的片段中改编了这个示例,但忽略了更新索引引用以匹配。

当然,您需要将long_text_field,field1和更改field2为模板可用的真实字段才能使其工作。

于 2018-06-22T13:38:14.910 回答
1

解决您问题的标题...

<pbr>您可以使用标签添加实际的分页符。您还可以设置新的页面布局。请参阅 BFO 文档了解更多信息。但是,您可能不希望使用它直接拆分表,除非您有逻辑来关闭并重新创建表数据的延续。 https://bfo.com/products/pdf/docs/userguide.pdf

切片表时,您想使用 CSS,例如page-break-inside: avoid; https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-inside

于 2018-06-23T20:17:24.330 回答