简体   繁体   English

当数据溢出到下一页时,列拉伸类型问题

[英]Column stretch type issue when data overflows to next page

I created a report with dynamic columns using dynamic reports. 我使用动态报表创建了带有动态列的报表。 If any column in the last row is overflows then the only the overflowing column is stretched and printed on next page. 如果最后一行中的任何列都溢出,那么只有溢出的列会被拉伸并打印在下一页上。 Rest of the columns is not stretched. 其余列未拉伸。

The printed report is look like this: 打印的报告如下所示: 打印的报告如下所示

Following section of code is used for creating report with dynamic columns. 代码的以下部分用于创建带有动态列的报告。

JasperReportBuilder jasperReportBuilder=DynamicReports.report();
for(Field field:fields){
    for (Entry<String, String> entry : dynamicTableColumns.entrySet()) {
        if ( entry.getKey().equals(field.getName())){
            jasperReportBuilder.columns(DynamicReports.col.column(entry.getValue(), field.getName().toString(), DynamicReports.type.stringType()).setStretchWithOverflow(true));
        }
    }
}

I haven't seen any option to set the column's stretch type as RELATIVE_TO_TALLEST_OBJECT. 我还没有看到任何将列的拉伸类型设置为RELATIVE_TO_TALLEST_OBJECT的选项。 Is there any other way to fix this ? 还有其他解决方法吗?

将明细的拆分类型设置为“ PREVENT”将防止该行延伸到下一页,并将整个行移到下一页。

jasperReportBuilder.setDetailSplitType(SplitType.PREVENT);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM