Jasper Reports,为整个组使用单一标签
我必须使用 Jasper Report 库和 iReport 创建报告。 报告中使用了数据分组。它应该以如下方式显示:
g a_line_in_the_group
r a_line_in_the_group
o a_line_in_the_group
u a_line_in_the_group
p a_line_in_the_group
1 a_line_in_the_group
g a_line_in_the_group
r a_line_in_the_group
o a_line_in_the_group
u a_line_in_the_group
p a_line_in_the_group
2 a_line_in_the_group
因此,一个组有一个标签。数据已分组,但标签仅显示在第一行,如下所示:
group1 a_line_in_the_group
a_line_in_the_group
a_line_in_the_group
我已为标签指定了属性 stretch
,但它没有帮助。
I have to create a report using Jasper Report library and iReport.
In the report is used data grouping. It should be shown in the next way:
g a_line_in_the_group
r a_line_in_the_group
o a_line_in_the_group
u a_line_in_the_group
p a_line_in_the_group
1 a_line_in_the_group
g a_line_in_the_group
r a_line_in_the_group
o a_line_in_the_group
u a_line_in_the_group
p a_line_in_the_group
2 a_line_in_the_group
So there is a single label for a group. The data is grouped, but the label is shown only in the first line, like this:
group1 a_line_in_the_group
a_line_in_the_group
a_line_in_the_group
I've specified the property stretch
for the label, but it doesn't help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将详细信息行放在组标签旁边...但您只能使用子报表来完成此操作。
在大多数情况下(我的意思是绝大多数情况),最简单也是最好的方法是将组标签显示在组标题中或仅显示在详细信息带中。在后一种情况下,它可以仅包含在组中的第一行或每一行中。 Alex K 的例子完美地展示了这些。
但是,当您确实希望组标签显示在详细信息旁边时,那么您将需要一个子报表。以下是它在 iReport 中的外观示例:
以下是预览时报表的呈现方式:
在我的示例中,我设置了组标签旋转。这在 PDF 中非常好,但在 HTML 中却不太好。但这只是一个细节;您可以随心所欲地呈现该标签。
You can put the detail rows next to the group label... but you'll only be able to do it using a subreport.
In most cases (and I mean a really overwhelming majority of cases) it is easiest and best to display the group label either into the group header or just displayed in the detail band. In the latter case it can be included on just the first row in the group or in every row. Alex K's example shows these perfectly.
But when you're in a case where you really want the group label to appear next to the details, then you'll need a subreport. Here's an example of how it would look in iReport:
Here's how that report renders when previewed:
In my example I set the group label rotation. This is great in PDF, but not so great in HTML. But that's just a detail; you can render that label however you like.
结果将是:
结果将是:
The result will be:
The result will be: