Can jasper reports use filterable custom data sources

只谈情不闲聊 提交于 2020-01-06 02:20:15

问题


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?

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?


回答1:


You really need to implement the JRQueryExecuter interface as well. Implementations of the interface are responsible for converting the query into a JRDataSource.



来源:https://stackoverflow.com/questions/4819766/can-jasper-reports-use-filterable-custom-data-sources

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!