jgardner16 Posted December 5, 2006 Share Posted December 5, 2006 Hi, I have a report that uses a JavaBean set datasource in Ireport and works fine the javabean returns a Collection. Is it possible to do this in JasperIntellegence by implementing ReportDataSourceService and if so how do I do this? If not is there another way to use a javabean datasource with JasperIntellegence. thanks Link to comment Share on other sites More sharing options...
lucianc Posted December 5, 2006 Share Posted December 5, 2006 You can plug-in your ReportDataSourceService implementation as data source for a report by defining a Spring bean data source. You would need to: Implement ReportDataSourceServiceCode:public class MyDataSourceService implements ReportDataSourceService { ..}Write a factory bean for MyDataSourceService, including all the properties needed to create a MyDataSourceService instanceCode:[code]public class MyDataSourceServiceFactory { private String prop1; private String prop2; //property setters public MyDataSourceService createDSService() { //use the props to instantiate the service return new MyDataSourceService(prop1, prop2); }}Configure a factory bean in Spring. You could do this using a file named applicationContext-myDataSource.xml placed under WEB-INF.Code:[code]<bean id="myDataSourceServiceFactory" class="MyDataSourceServiceFactory"> <property name="prop1" value="value1"/> <property name="prop2" value="value2"/></bean>Create in JI a bean data source, having myDataSourceServiceFactory as bean name and createDSService as method name.Select the bean data source when creating the report unit.[/ul] Regards,Lucian Link to comment Share on other sites More sharing options...
jgardner16 Posted December 6, 2006 Author Share Posted December 6, 2006 The thing that I confused about is how does the report get the Collection? thanksJeff Link to comment Share on other sites More sharing options...
jgardner16 Posted December 6, 2006 Author Share Posted December 6, 2006 Hi, Is there sample of this in action. I implemented in ReportDataSourceService I just don't know how to pass my Collection to the report. I am not getting any exceptions just a report with no data. thanks Link to comment Share on other sites More sharing options...
jgardner16 Posted December 6, 2006 Author Share Posted December 6, 2006 Found a good example if anyone is interested in the package com.jaspersoft.jasperserver.datasource.test. thanks Link to comment Share on other sites More sharing options...
sjanarthanan Posted December 16, 2006 Share Posted December 16, 2006 Hi Jeff, Could you please point me where you found the packagecom.jaspersoft.jasperserver.datasource.test. Thank You. Link to comment Share on other sites More sharing options...
swood Posted December 17, 2006 Share Posted December 17, 2006 It is in the source distribution. ShermanJasperSoft Link to comment Share on other sites More sharing options...
hablutzel1 Posted November 4, 2009 Share Posted November 4, 2009 Downloading the source :), by the way, there is really really poor documentation about custom data sources for jasperserver, they always refer to their ultimate guide, but well, I can't buy it yet. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now