Jasper reports 多行Jasper报表操作

Jasper reports 多行Jasper报表操作,jasper-reports,Jasper Reports,Jasper report在从数据库获取值时是如何工作的。 我知道每一行都会重复使用细节栏,但我的问题是: 1) Do all DB rows gets fetched first and then detail band gets repeated for each row. or 2) It is parallel process as soon as report gets one row it creates new detail ba

Jasper report在从数据库获取值时是如何工作的。 我知道每一行都会重复使用细节栏,但我的问题是:

1) Do all DB rows gets fetched first and then detail band gets repeated for each row. or 2) It is parallel process as soon as report gets one row it creates new detail band. 1) 是否先获取所有DB行,然后对每行重复细节栏。 或 2) 这是一个并行过程,只要报表获得一行,它就会创建新的详细信息栏。 我问这些问题的原因是,我想对所有行进行一些操作,因为在我的详细栏中有一个元素,每个栏中应该打印还是不打印

示例:假设我的数据库总是返回两行,一行为public,一行为private,我必须比较其中的一列,将name作为整体_分数,如下所示:

1) If private overall_score is greater than public the header private should be underlined. 2) if public overall_score is greater than private the header public should be underlined. 3) if both overall_score are equals both header should be underline. 1) 如果private综合评分大于public,则标题private应加下划线。 2) 如果public的总评分大于private,则标题public应加下划线。 3) 如果两个总分相等,则两个标题都应加下划线。 我在细节栏上有一个line元素,我想在这两行的总评分比较的基础上,在上面打印WhenExpression

请帮助我,我是Jasper Report的新手。

你可以试试这个

  • 在记录对上的任何公共字段上创建一个组。如果不希望在报告中显示组页眉和页脚标注栏,可以将其高度设置为零
  • 创建一个变量,该变量可获取每个组的最大总体_分数值
  • 在PrintWheenexpression中,将当前记录的总体_分数与包含组的最大总体_分数的变量进行比较

  • Hi@Tom,如果记录按降序排列,则解决方案有效。例如,组将仅对计算时获取的行数进行计算。因此,如果第一条记录的值为80,第二条记录的值为85,则第一条记录的最大值为80,第二条记录的最大值为85,另一种可能是将组max作为查询中的字段。您可以使用子选择查询来执行此操作。然后你可以在打印时使用它。