Birt条件分页符

时间:2018-07-23 15:40:50

标签: eclipse birt maximo

我正在设计应该在表格上打印的BIRT报告。在此报告中,它正在两面打印,因此如果工作单的详细信息以奇数结尾,则客户要进行分页操作,这样两个工作单就不会在同一张纸上。

是否可以添加pagecount()并在工作订单的末尾加上奇数号时分页?

谢谢。

1 个答案:

答案 0 :(得分:0)

我只有部分答案。在ReportDesign部分的beforeFactory中添加分页是可能的。 Maximo报告开箱即用,具有PDF的分页声明。您可以扩展if语句-请参见下面的OOTB代码示例。

您将需要能够带回WO号作为全局参数。这就是您需要做一些其他研究的地方。

if ( (reportContext.getParameterValue("usepagebreaks") == "false")|| reportContext.getOutputFormat() == "pdf" ) {
// Give each table in the report a name, and add the names to the list below, e.g. ["mainTable", "childTable1"]
var tableListing = ["dataSet_inventory_id13#"];
for each(var tableName in tableListing) {
    var table = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement(tableName)
    if (table != null) {
        table.setProperty("pageBreakInterval", 0);
    }
}

}