Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » set report parameter in script
set report parameter in script [message #988414] Thu, 29 November 2012 19:57 Go to next message
nari noori is currently offline nari nooriFriend
Messages: 33
Registered: November 2012
Member
hi,

im trying to set the default value of report parameters before the "report parameter page" is shown, this i want to do in a script, for example "initialize" .

ive tried this, with no effect:
params["test"].value = "testvalue"

all help appriciated thanks.,
Re: set report parameter in script [message #988438 is a reply to message #988414] Thu, 29 November 2012 21:45 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Why not set it in the parameter script:
http://www.eclipse.org/birt/phoenix/project/notable2.5.php#jump_2

Jason
Re: set report parameter in script [message #988444 is a reply to message #988438] Thu, 29 November 2012 22:01 Go to previous messageGo to next message
nari noori is currently offline nari nooriFriend
Messages: 33
Registered: November 2012
Member
Thank you for your reply, Jason.

The reason i want to set the parameter in the script is to make a generic way to set parameters in one place, as the reason behind setting the parameters are:
1-read parameters earlier set for this report from my database.
2-set these parameters through script. As i already know the parameternames and values (from my database).

If i have to set them parameter by parameter in the parameter script, it would work, but wont be a good solution i think.

But isnt there a way to set the parameter values in the script, havent seen any post about it, been searching for an answer for some days now.

Re: set report parameter in script [message #988448 is a reply to message #988444] Thu, 29 November 2012 22:08 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can set parameters in the beforeFactory like:

reportContext.setParameterValue("NewParameter", 2); Or using the code you posted should work.
The problem will be the parameter box will display the default value you designed in. If you hit ok on it the new value will then be set in the parameter box. You can hide the parameter box in a couple of ways, but I am not certain that is what you need.

Jason
Re: set report parameter in script [message #988451 is a reply to message #988448] Thu, 29 November 2012 22:33 Go to previous message
nari noori is currently offline nari nooriFriend
Messages: 33
Registered: November 2012
Member
Hi jason, i tried your suggestion without succeeding. it didnt set the parameter value

ive attached my rptdesign file
Previous Topic:Report Designer terribly slow in Linux
Next Topic:Chart Legend Link to Bookmark fail
Goto Forum:
  


Current Time: Thu Apr 25 13:35:05 GMT 2024

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

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

Back to the top