JasperReports:是否可以使用多个数据源,如果没有,可以在参数中使用集合? [英] JasperReports: is it possible to use multiple data sources, or if not, to use collections in parameters?

查看:306
本文介绍了JasperReports:是否可以使用多个数据源,如果没有,可以在参数中使用集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

报告习惯用语似乎是一个报告由一个项目列表组成,还有一些额外的数据(参数)。有没有办法在报告中包含几个不相关的列表,或者这是否会违背成语,以至于应该使用不同的工具来生成输出?





简而言之:你能在报告中使用几个不相关的列表吗?

解决方案

我认为您想要的是报表中的子报表。



子报表可以有与主报告不同的数据源。



这是教程


It seems that the reporting idiom is that a report consist of a single list of items, with some additional data (parameters). Are there ways to include several unrelated lists in a report, or would this go against the idiom to such an extent that a different tool should rather be used to generate the output?

Suppose, for instance, you have a list of Persons that lives in a Building, with names, phone numbers and so on. This list would be the main datasource. Additionally, on the same report you want to show various other information about that Building, such as address, number of floors and so on. The number of items in this information might vary between Buildings, so that you cannot simply put it into static parameters, but would need a map or a list. This is of course a contrieved example, but should serve to illustrate the problem.

In short: can you use several unrelated lists in a report?

解决方案

I think what you want is a Subreport within your report.

A Subreport can have a different datasource than the main report.

Here is a tutorial on how to create one.

这篇关于JasperReports:是否可以使用多个数据源,如果没有,可以在参数中使用集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆