Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Replace string in various queryText
Replace string in various queryText [message #1015055] Wed, 27 February 2013 10:12 Go to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
Hi all,
i have 3 queries in which i must replace some parameters, i do it in each of the 3 events beforeOpen with the same script, there is a possibility to insert this script only once and replace the parameters in my 3 queries?
Thanks
Re: Replace string in various queryText [message #1015290 is a reply to message #1015055] Thu, 28 February 2013 04:37 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1687
Registered: July 2009
Senior Member

Maybe I'm not understanding correctly, but you should be able to use variables or parameters in your beforeOpen script of each dataSet. Then, you'd only have to change the parameter or variable in one place. If I'm misunderstanding, please explain the issue in a little more detail. Thanks!

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Replace string in various queryText [message #1015390 is a reply to message #1015290] Thu, 28 February 2013 13:14 Go to previous messageGo to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
Michael Williams wrote on Wed, 27 February 2013 23:37
Maybe I'm not understanding correctly, but you should be able to use variables or parameters in your beforeOpen script of each dataSet. Then, you'd only have to change the parameter or variable in one place. If I'm misunderstanding, please explain the issue in a little more detail. Thanks!

Hy Michael,
yes you understanding correctly, my requirement is that the script is the same, but the place in which is present no, so if i have to modify the script, then i have to change the various queries.
Re: Replace string in various queryText [message #1015476 is a reply to message #1015390] Thu, 28 February 2013 16:37 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1687
Registered: July 2009
Senior Member

Can you create a report that uses the sample database that shows how your report is set up and how you're currently changing the queries? It might be easier for me to understand if I see it.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Replace string in various queryText [message #1016029 is a reply to message #1015476] Mon, 04 March 2013 16:16 Go to previous message
Jakob Altenstein is currently offline Jakob AltensteinFriend
Messages: 19
Registered: February 2013
Junior Member
As I understand it, you should solve your problem with external javascript files. In the report, go to Properties Editor -> Resources -> Javascript Files. There you can add a javascript file which will hold the function to adjust your query. In the beforeOpen() method of your datasets, you can then call the function, providing the query text or whatever parameter you'll need in the query.

Make sure that in BIRT your resource folder is set to the folder where you then put your *.js file (window -> preferences -> report design -> resource -> resource folder
Previous Topic:Wrapped texts when export to ODP
Next Topic:Style - Format Number
Goto Forum:
  


Current Time: Sun Dec 21 12:50:58 GMT 2014

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

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