Usage of an other DataSource
I can fill a ordinary JasperReport with a Java-Object: JRDataSource (Interface).
Is it able to fill the reports for the JasperServer manually (no JDBC/JNDI DataSource).
I need this, if I wont to preprocess the data to display!
I hope for your help,
By: Sherman Wood - sgwood
RE: Usage of an other DataSource
At this time, we have only included JDBC and JNDI data sources. We need to do some work to allow other data sources to be attached to reports, defining the metadata about the data sources and the machinery to connect to them. This will need to be pluggable, so that people can plug their own data sources in.
This work is not going to be done for the release in June, but definitely the release after that in July/August.
How would one post process/preprocess data? I have a report that I can't solve with just SQL. I've looked into datasource, scriptlet, and query executor, but I can't seem to read the report parameters. Ideally, I would want to read the REPORT_CONNECTION and other user parameters, call the DB directly, and then dump out some kind of processed (with my Java code) result set for reporting.
A query executer has access to report parameters and can create custom data source object that would be used for reports. You should post more details about what you've tried and what didn't work to get meaningful feedback.
Thanks for the quick reply. Anyways, is query executor "the one" to use when it is necesary to dynamically generates the result set? Is that supported in the newest JasperServer, as I am working with one that only says, "Copyright © 2000-2008 JasperSoft Corporation". While browsing the 3.5 documentation, I've found JRFillDatasetScriptlet. What is it?
Anyways, is query executor "the one" to use when it is necesary to dynamically generates the result set?
Actually if you plan to deploy your reports in JasperServer, you should start by looking into custom data sources. Check the user guide and the samples shipped with JS for information on how this works.
As part of the custom data source implementation, you might or might not need to implement a query executer as well. This mainly depends on whether you need to embed queries in report or not.
Regarding JRFillDatasetScriptlet, that's a class which is internally used by JasperReports during the report fill process. It can't help you.
Many thanks again. I was able to do what I need using the query executer. Originally, I was trying to solve the problem with a custom datasource, but I was not able to read the parameter values. The JRDataSourceProvider.create() method only sends in a JasperReport instance, and that means I can only get JRParameters out of it. I've checked to see if they can be up cast to JRValueParameters, but they can't. Without parameters, I would have to create the JDBC connection myself, which is highly non-portable. Also, without reading any parameter, I can't get my report's input anyways.
Regardless, it seems to be working, and now I have to figure out how to move my report from Netbeans to JasperServer. ;)