Skip to main content



      Home
Home » Archived » BIRT » How to switch datasource using javascript?
How to switch datasource using javascript? [message #1061295] Fri, 31 May 2013 00:58 Go to next message
Eclipse UserFriend
I have a report using datasources from a library. Now I want to assign datasource for my dataset at runtime based on a parameter. How can I do it using javascript from report design?

Thanks
Re: How to switch datasource using javascript? [message #1061527 is a reply to message #1061295] Sat, 01 June 2013 23:02 Go to previous messageGo to next message
Eclipse UserFriend
Is the other dataSource in the library as well? Can you explain the situation some more?
Re: How to switch datasource using javascript? [message #1061775 is a reply to message #1061527] Mon, 03 June 2013 17:56 Go to previous messageGo to next message
Eclipse UserFriend
yes, the othere datasource is in library as well. The report that I am working on has two data sources that added from library. There's a parameter on the report indicates which data source the data set should use at runtime. At begining I thought there should be a java script function 'setDataSource()' or something of data set, but I only found getDataSource(), there's no setDataSource(). Can anyone help me with it?

Thanks
Re: How to switch datasource using javascript? [message #1062494 is a reply to message #1061775] Sat, 08 June 2013 01:41 Go to previous messageGo to next message
Eclipse UserFriend
Try something like this in the beforeOpen of the dataSet:

this.setExtensionProperty("dataSource","otherDataSourceName");
Re: How to switch datasource using javascript? [message #1063268 is a reply to message #1062494] Wed, 12 June 2013 17:22 Go to previous messageGo to next message
Eclipse UserFriend
This doesn't work. Any other idea?
Re: How to switch datasource using javascript? [message #1063276 is a reply to message #1063268] Wed, 12 June 2013 17:53 Go to previous messageGo to next message
Eclipse UserFriend
I think I found a solution. In initialize of report add this reportContext.getDesignHandle().getElementByID("idOfDataSetElement").setDataSource("dataSourceName");
Re: How to switch datasource using javascript? [message #1064381 is a reply to message #1063276] Wed, 19 June 2013 00:38 Go to previous message
Eclipse UserFriend
Great! Glad you found a solution. I was out of town the end of last week, so I've not been able to make it back in here, til now. Smile Let us know whenever you have questions!
Previous Topic:Integrating perspective BIRT into RCP application
Next Topic:Change grid cells content dynamically
Goto Forum:
  


Current Time: Wed Mar 26 08:08:23 EDT 2025

Powered by FUDForum. Page generated in 0.06672 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top