« Return to Thread: OdaDataSetHandle ref for existing .rptdesign template

RE: OdaDataSetHandle ref for existing.rptdesign template

by Tom Corcoran :: Rate this Message:

Reply to Author | View in Thread

The BIRT apis do seem to have a big learning curve, It's frustrating that they are still being fundamentally changed it seem; we were disappointed to find after purchasing the 2 BIRT addison wesley books 2 weeks ago, the examples given around this functionality are already out of date with BIRT 2.2.

So now I have:

EngineConfig config = new EngineConfig();
config.setBIRTHome("birt-runtime-2_2_2/ReportEngine");
Platform.startup(config);        
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY)
IReportEngine engine = factory.createReportEngine(config)
IReportRunnable design = engine.openReportDesign('reports/myreport.rptdesign')    
ReportDesignHandle report = (ReportDesignHandle) design.getDesignHandle();
DataSourceHandle dso = report.findDataSet('TestSet') // your suggestion

this gives:

Unexpected exception: Cannot cast object 'org.eclipse.birt.report.model.api.OdaDataSetHandle@1108727' with class 'org.eclipse.birt.report.model.api.OdaDataSetHandle' to class 'org.eclipse.birt.report.model.api.DataSourceHandle


Any help appreciated.

Yu Li wrote:
ReportDesignHandle.findDataSet(datasetname);

Or you can get the dataset list:
ReportDesignHandle.getDataSets();

Thanks!

-----Original Message-----
From: birt-report-designer-dev-bounces@eclipse.org
[mailto:birt-report-designer-dev-bounces@eclipse.org] On Behalf Of Tom
Corcoran
Sent: Thursday, May 29, 2008 4:22 PM
To: birt-report-designer-dev@eclipse.org
Subject: [birt-report-designer-dev] OdaDataSetHandle ref for
existing.rptdesign template


Starting with a .rptdesign template I am looking to manipulate this at
runtime to run against a number of databases.

http://dev.eclipse.org/newslists/news.eclipse.birt/msg20490.html
outlines doing
OdaDataSetHandle dsHandle = designFactory.newOdaDataSet( "ds",
       
"org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" );
I could then point odaURL to the new database, using:
                dsHandle.setProperty( "odaURL",
"jdbc:classicmodels:sampledb" );

My question is how can I get an instance of OdaDataSetHandle for
existing
.rptdesign rather than create a new one?

--
View this message in context:
http://www.nabble.com/OdaDataSetHandle-ref-for-existing-.rptdesign-templ
ate-tp17517667p17517667.html
Sent from the Eclipse BIRT - Report Designer - Dev mailing list archive
at Nabble.com.

_______________________________________________
birt-report-designer-dev mailing list
birt-report-designer-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/birt-report-designer-dev
_______________________________________________
birt-report-designer-dev mailing list
birt-report-designer-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/birt-report-designer-dev

 « Return to Thread: OdaDataSetHandle ref for existing .rptdesign template