Skip to main content



      Home
Home » Archived » BIRT » Replace string in various queryText
Replace string in various queryText [message #1015055] Wed, 27 February 2013 05:12 Go to next message
Eclipse UserFriend
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] Wed, 27 February 2013 23:37 Go to previous messageGo to next message
Eclipse UserFriend
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!
Re: Replace string in various queryText [message #1015390 is a reply to message #1015290] Thu, 28 February 2013 08:14 Go to previous messageGo to next message
Eclipse UserFriend
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 11:37 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Replace string in various queryText [message #1016029 is a reply to message #1015476] Mon, 04 March 2013 11:16 Go to previous message
Eclipse GuestFriend
Messages: 93
Registered: February 2013
Location: Vienna
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: Mon Apr 14 17:41:46 EDT 2025

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

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

Back to the top