以矩阵格式打印 Jasper 报告数据
我有一种情况需要以矩阵格式打印数据。 我有主报告和子报告。我从主报告将列表(对象)传递到子报告。在子报告中,我必须以表格/矩阵格式打印对象数据,如下所示:
___________________________________
| Name1 | Name2 | Name3 |
| Address1 | Address2 | Address3 |
| Phone1 | Phone2 | Phone3 |
|__________|____________|__________|
| Name1 | Name2 | Name3 |
| Address1 | Address2 | Address3 |
| Phone1 | Phone2 | Phone3 |
每行将有 3 列,并且将有 X 列。行数取决于列表长度(列表大小 3 为 1 行,列表大小 6 为 2 行等...)
我正在尝试使用 crosstab
,但它似乎不是理想的解决方案。请告诉我如何实现这种矩阵格式的报告数据。
I have a situation where I need to print data in matrix format.
I have main report and subreport. From the main report I am passing a list (objects) to the subreport. Inside the subreport I have to print object data in tabular/matrix format as below:
___________________________________
| Name1 | Name2 | Name3 |
| Address1 | Address2 | Address3 |
| Phone1 | Phone2 | Phone3 |
|__________|____________|__________|
| Name1 | Name2 | Name3 |
| Address1 | Address2 | Address3 |
| Phone1 | Phone2 | Phone3 |
Each row will have 3 columns and there will be X no. of rows depending on list length (1 row for list size 3 and 2 for list size 6 etc...)
I am trying to use crosstab
, but it does not seems to be ideal solution. Please advice me how to achieve this matrix format of report data.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不太确定我明白你的意思,但在这里:
在
行组
的交叉表属性中Bucket Expression
($F{REPORT_COUNT}/3)+1
列组
中添加一个新组,其中包含存储桶表达式
($F{REPORT_COUNT}%3)+1
在此情况下,每 3 条记录将开始一个新行,并且每行仅包含 3 列。
Not exactly sure i got you, but here:
In the crosstab properties
Row group
add a new group, withBucket Expression
($F{REPORT_COUNT}/3)+1
Column group
add a new group, withBucket Expression
($F{REPORT_COUNT}%3)+1
In this was, a new row will be started every 3 records, and every row will contain only 3 columns.