iReport,如何打印不同表的字段
我的报告中需要多个查询,因此我添加了一个新数据集。 问题是我无法在报告中使用新数据集的字段,错误是:字段不存在。
那么,如何在报告中进行多个查询(以打印不同表的字段)而不为每个字段创建子报告?
谢谢。
I need multiple queries in my report so i added a new dataset.
The problem is i can't use fields of new dataset in my report, the error is: field does not exists.
So, how can i have multiple query in my report(to print fields of different table) without create a subreport for each field?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这不是 iReport 的工作方式。您需要将所有数据放入一个数据集中才能并排使用这些字段。请参阅 @GenericJon 关于使用
datasetRun
的详细答案,其中您的字段用作输入参数来定义另一个数据集。如果您确实想要,可以使用参数来传递数据集运行中的输出字段。这输出数据集 1 > 字段 1 / 数据集 2 > 字段 2。
我会进一步建议您在 iReport 之外进行尽可能多的数学计算和整理,即如果您的数据源是数据库,则使用存储过程。
Unfortunately this isn't how iReport works. You need to get all your data into one dataset to use the fields side by side. See @GenericJon's detailed answer on using a
datasetRun
where your fields are used as input parameters to define another dataset.If you really want the parameters can be used to pass a field for output in a datasetRun. This outputs Dataset1>Field1 / Dataset2>Field2.
I would go further to suggest you do as much of the math and collating outside of iReport too, i.e. use stored procedures if your data source is a database.