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

RE: OdaDataSetHandle ref forexisting.rptdesign template

by Tom Corcoran :: Rate this Message:

Reply to Author | View in Thread

Doh. I guess it was a long day! Grrrr I never spotted that. Thanks :-)


Any BIRT API change we make sure we do take care of the backward
compatibility issue. For your code, I think maybe you should write:

DataSetHandle dso = report.findDataSet('TestSet')
The OdaDataSetHandle cannot be casted to a  DataSourceHandle.

-----Original Message-----
From: birt-report-designer-dev-bounces@eclipse.org
[mailto:birt-report-designer-dev-bounces@eclipse.org] On Behalf Of Tom
Corcoran
Sent: Friday, May 30, 2008 7:52 AM
To: birt-report-designer-dev@eclipse.org
Subject: RE: [birt-report-designer-dev] OdaDataSetHandle ref
forexisting.rptdesign template

EngineConfig config = new EngineConfig();
config.setBIRTHome("birt-runtime-2_2_2/ReportEngine");
Platform.startup(config);        
IReportEngineFactory factory = (IReportEngineFactory)
Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGIN
E_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

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