简体   繁体   English

如何在JasperReports Server中创建多个数据源?

[英]How to create Multiple Datasource in JasperReports Server?

I use JasperReports Server 5.5 community edition . 我使用JasperReports Server 5.5社区版 My company has 3 branches. 我公司有3个分支机构。 Each Branch has each database (datasource), but it use the same report. 每个分支都有每个数据库(数据源),但是它使用相同的报告。

How to use the same report in 3 branches? 如何在3个分支中使用相同的报告? Please advise me to solve this solution. 请建议我解决此解决方案。

I am assuming that you are designing your report using iReport/ Jaspersoft Studio, there in you could create sub-datasets in your report and then use it in your report, either by using lists or by using subreports or tables or whatever suits your purpose. 我假设您正在使用iReport / Jaspersoft Studio设计报表,可以在其中创建报表的子数据集,然后通过使用列表,子报表或表或任何适合您的目的的方式在报表中使用它。

Then in the Jasper Server you need to add all the three different datasources, and then upload your report giving references to these datasources, in case of sub reports you need to add the JRXML's as the resources to the main report while uploading and JasperServer would consider various datasources. 然后在Jasper Server中,您需要添加所有三个不同的数据源,然后上载报告以提供对这些数据源的引用,如果是子报告,则在上载时需要将JRXML作为资源添加到主报告中,JasperServer会考虑各种数据源。

Hope that this helps. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM