java - 在打印组后计算 JasperReports scriptlet 中的值
问题描述
我有以下 JasperReport 脚本,它工作正常:
public class ReportScriptlet extends JRDefaultScriptlet {
public void beforeGroupInit(String groupName) throws JRScriptletException {
System.out.println("in beforeGroupInit - " + groupName);
}
public void afterGroupInit(String groupName) throws JRScriptletException {
System.out.println("in afterGroupInit - " + groupName);
}
}
问题是在打印组的beforeGroupInit
行afterGroupInit
之前运行,我需要在打印行之后进行计算。
既然没有afterGroupFinalized
事件,有没有不同的方法来实现这一点?
解决方案
为什么不使用 GroupFooter?您可以创建一个新变量,设置您的计算并在变量表达式中设置正确的字段
推荐阅读
- sql - 如果 count 为 0,则跳过数据库记录
- c# - 如何在 C# 中使表单可见
- android-annotations - AndroidAnnotions:在发布 buildType 找不到符号
- java - 如何使用 XSLT 根据 XML 文件中的值计数更改属性值
- android - 如何在 Android Studio 中更改 XML 文件中的命名空间前缀颜色
- java - 如何在 Vaadin 中使用 Java 设置 ListBox 的宽度?
- angularjs - 会话过期后 Symfony 不会重定向到登录路由
- mysql - 如何使用更新查询从逗号分隔的字符串中删除值?
- c++ - 在定义的异常类中捕获程序中止
- ruby-on-rails-5 - update 和 update_attributes 的区别