Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Adding Multiple Data Sources/Sets to a Report
jmanes
<p>Hello everyone. Newbie to birt here.</p><p> </p><p>I am currently working on a project that allows users to create a new birt report based on a data source/set. This is not so hard, but the problem I am having is allowing the user to add multiple data sources/sets via wizard. I have a wizard that prompts the user to select their data source and after clicking finish it adds that to a new report.</p><p> </p><p>I have been looking for some documentation about how to do this and have found nothing. Would I simply add multiple OdaDataSets to the ReportDesignHandle? I'm not really sure how to go about this or how it is done. If anyone could give me some pointers or a link to some documentation I would be very grateful.</p><p> </p><p>Thanks!</p>
Find more posts tagged with
Comments
kclark
<p>You're correct that you would add the second data source to the design handle. Take a look at this code</p><pre class="_prettyXprint"> void buildDataSource( ) throws SemanticException { OdaDataSourceHandle dsHandle = designFactory.newOdaDataSource( "Data Source", "org.eclipse.birt.report.data.oda.jdbc" ); dsHandle.setProperty( "odaDriverClass", "org.eclipse.birt.report.data.oda.sampledb.Driver" ); dsHandle.setProperty( "odaURL", "jdbc:classicmodels:sampledb" ); dsHandle.setProperty( "odaUser", "ClassicModels" ); dsHandle.setProperty( "odaPassword", "" ); OdaDataSourceHandle dsHandle1 = designFactory.newOdaDataSource( "Data Source 1", "org.eclipse.birt.report.data.oda.jdbc" ); dsHandle.setProperty( "odaDriverClass", "org.eclipse.birt.report.data.oda.sampledb.Driver" ); dsHandle1.setProperty( "odaURL", "jdbc:classicmodels:sampledb" ); dsHandle1.setProperty( "odaUser", "ClassicModels" ); dsHandle1.setProperty( "odaPassword", "" ); designHandle.getDataSources( ).add( dsHandle ); designHandle.getDataSources( ).add( dsHandle1 ); }</pre><p>It builds two data sources then they are both added through the same design handle. You should be able to do the same thing with your data set.</p>