Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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: 146
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: 1925
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

Developer Evangelist, Silanis
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: 146
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: 1925
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

Developer Evangelist, Silanis
Re: Replace string in various queryText [message #1016029 is a reply to message #1015476] Mon, 04 March 2013 16: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: Fri Mar 29 08:56:09 GMT 2024

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

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

Back to the top