碧玉报表可以使用可过滤的自定义数据源吗 [英] Can jasper reports use filterable custom data sources
问题描述
我正在考虑使用Jasper Reports处理大型数据库(数十GB数据)的报告,但是我的数据使用 JRDataSource .但是,我要处理的数据量意味着仅实现接口将迫使报表获取和过滤太多数据.我需要将过滤职责推给数据库系统,以提高实用速度,但是我看不到自定义数据源从报表中获取过滤参数的任何方法. Jasper Reports可能吗?是否有针对这种情况的示例或教程?
I'm looking at using Jasper Reports to handle reporting for a large database (tens of gigabytes of data), but my data uses an EAV format. As far as I can tell, this means I'd need to use a custom data model, as a Java class implementing JRDataSource. The amount of data I'm dealing with, however, means that simply implementing the interface would force the report to fetch and filter far too much data. I'd need to push the filtering duties to the database system to get any practical speed, but I can't see any way for the custom data source to get the filtering parameters from the report. Is it possible with Jasper Reports? Are there any examples or tutorials for this sort of scenario?
为澄清起见,我想做这种事情:假设我想要一份有关特定日期每个属性最大值的报告.我可以设置一个数据源,将一个通用的日期过滤器添加到它的SQL查询中,但是如何告诉数据源它需要使用的特定日期呢?
To clarify, I want to do this sort of thing: Say I have wanted a report on the maximum values for each attribute on a specific day. I can set up a data source that adds a generic date filter to its SQL query, but how do I tell the data source the specific date it needs to use?
推荐答案
You really need to implement the JRQueryExecuter interface as well. Implementations of the interface are responsible for converting the query into a JRDataSource.
这篇关于碧玉报表可以使用可过滤的自定义数据源吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!