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)
Runtime DataSource change for a DataSet with JScript
griniland
<p>I Have great need to replace during runtime DataSource handle for several DataSets, how should I do this ?</p><p> </p><p>I can get runtime handle to DataSource:</p><p>hDataSource = reportContext.getReportRunnable().designHandle.getDesignHandle().findDataSource("DataSource")</p><p> </p><p> </p><p>Setting property "dataSource" is not solution in my case. I need something like setDataSource(hDataSource), but don't know, where to search.</p><p> </p>
Find more posts tagged with
Comments
CBR
<p>Hi,</p><p> </p><p>please keep in mind that changing something in the designHandle only effects the element if it has been placed in the beforeFactory event of the report. If you place it somewhere else it doesn't effect the report at all.</p><p> </p><p>What do you want to do in detail? Perhaps it is much easier to change the properties of the existing datasource instead of creating a complete new one. If you have the need to also change the datasource type you will be unlucky: Every dataset in your report has information about the type of the datasource. If it no longer matches during report execution BIRT will throw an error. Anyways this makes sense because you will be unlucky executing a SQL query on a CSV file.</p>
griniland
<p>Firts of all, thank You for answer.</p><p> </p><p>My case is caused by BIRT limitations and bugs in using rptlibrary components.</p><p> </p><p> </p><p>Project uses XML DataSource dummy.xml file (during developement stage). When report is launched on Application Server - </p><p>AppContext.put("org.eclipse.datatools.enablement.oda.xml.inputStream", new InputStream(<data>) is used to set actual data for a report.</p><p>And here comes the problem - DataSources defined in rptlibraries conflict with DataSource used in main report (they all try to read one Input stream, and only one can do this).</p><p>Actually, I want one DataSource for all - for main report and report library component. If I could replace somehow DataSource Handle - i would succeed.</p>