Usage of an other DataSource

By: Johann Rosner - xsare
Usage of an other DataSource
2006-05-23 05:38
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,
Sincerely

Johann Rosner
Deutschland


By: Sherman Wood - sgwood
RE: Usage of an other DataSource
2006-05-23 06:36
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.


Sherman
JasperSoft
ktrinad's picture
1157
Joined: Aug 9 2006 - 2:36am
Last seen: 16 years 10 months ago

5 Answers:

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.

raychen's picture
41
Joined: Apr 6 2009 - 12:42pm
Last seen: 14 years 2 months ago

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.

Regards,

Lucian

lucianc's picture
76636
Joined: Jul 17 2006 - 1:10am
Last seen: 5 days 1 hour ago

Lucian,

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?

raychen's picture
41
Joined: Apr 6 2009 - 12:42pm
Last seen: 14 years 2 months ago

raychen
Wrote:

Lucian,

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.

Regards,

Lucian

lucianc's picture
76636
Joined: Jul 17 2006 - 1:10am
Last seen: 5 days 1 hour ago

Lucian,

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. ;)

 

raychen's picture
41
Joined: Apr 6 2009 - 12:42pm
Last seen: 14 years 2 months ago
Feedback