[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.birt] Re: Change library Datasource URL at runtime

Anthony,

can you post the code you used to do this?

Jason

Anthony wrote:
Actually, the workaround via the API - adding a datasource at runtime, and setting it as the source for each dataset - doesn't work, since the datasets and datasource are in a library - you get an exception:

org.eclipse.birt.report.model.api.IllegalOperationException: The module is read-only and operation is forbidden.

Anthony

Anthony wrote:

In the library I have the datasource, and the parameter, and the property binding is set there in the Edit Data Source -> Property Binding screen.

Report parameter binding in datasets in the library *does* seem to work if I hard code the datasource, so I believe the problem is with the datasource.

I can display the parameter values in a dynamic text field just fine so I know they are being passed into the report.

It doesn't seem to make any difference if the parameters are also in the Report (rather than just in the library) - I'm not sure whether or not they should be?

I believe this *does* worked in some cases, so perhaps there is some other condition triggering this.

Anthony

Jason Weathersby wrote:

Anthony,

I tried this with BIRT 2.3.1 and it worked for me. Do you have the parameter and the ds in the library and did you set the property binding in the lib?

Jason

Anthony wrote:
Changing a datasource URL at runtime is trivial using property binding and report parameters (e.g. params["runtimeURL"].value). However this doesn't seem to work when the datasource is in a library - the parameters are ignored, and the defaults are used. So I have two questions

1) How can I change the JDBC driver URL of a datasource once the report is loaded as IReportRunable? Or can I only do it by creating a new datasource and updating all the datasets to reference it?

2) Is there a way to get this to work with property binding and report parameters? Or is it not possible to use libraries to share datasources that need to be changed at runtime? https://bugs.eclipse.org/bugs/show_bug.cgi?id=154189 makes it look like it's not.