Home
Analytics
Birt Report Parameters
Khoza
Hi There
I am new birt report developer, i have created 3 report parameters which are params["RP_IN_Date_From"].value, params["RP_IN_Date_To"].value, params["RP_IN_Default"].value. My question is: how do I go about assigning values on params["RP_IN_Date_From"].value and params["RP_IN_Date_To"].value using JavaScript expression on beforeOpen() event of DateSet and using params["RP_IN_Default"].value as conditional parameter that receives Y or N values, if the value of a conditional parameter is Y then assign values to params["RP_IN_Date_From"].value and params["RP_IN_Date_To"].value parameters using JavaScript expression on beforeOpen() event of DateSet.
Thanking you in advance
Lucky
Find more posts tagged with
Comments
Megha Nidhi Dahal
Hi Lucky, <br />
<br />
You can compare the params["RP_IN_Default"] like a normal string. You can do something like:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if(params["RP_IN_Default"] == "Y")
//use the values in params["RP_IN_Date_From"] and params["RP_IN_Date_To"]
else if(params["RP_IN_Default"] == "N")
//do something
else
//Happy New Year
</pre>
<br />
Hope I have understood you correctly.<br />
<br />
regards<br />
Arpan
Khoza
<blockquote class='ipsBlockquote' data-author="'Arpan'" data-cid="71391" data-time="1292408929" data-date="15 December 2010 - 03:28 AM"><p>
Hi Lucky, <br />
<br />
You can compare the params["RP_IN_Default"] like a normal string. You can do something like:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if(params["RP_IN_Default"] == "Y")
//use the values in params["RP_IN_Date_From"] and params["RP_IN_Date_To"]
else if(params["RP_IN_Default"] == "N")
//do something
else
//Happy New Year
</pre>
<br />
Hope I have understood you correctly.<br />
<br />
regards<br />
Arpan<br /></p></blockquote>
Khoza
Thanks a lot Arpan
Another Question:
How do you override/cancel the value of Is required report parameter or null value report radio button parameter using javascript code. Because i want to force Is required report parameter to take null value and to force as well null value report radio button parameter to receive a different value instead of returning null value.
Thanks in advance,
Lucky Khoza
Megha Nidhi Dahal
Hi Lucky,<br />
<br />
Sorry, was out of station for a few days.<br />
You can set values for these parameters from the java code which is starting the BIRT engine. I don't have much idea on the code sequence to do it, but I'm very sure that you will get this information on the net.<br />
<br />
Q: Why do you want to make a parameter as <pre class='_prettyXprint _lang-auto _linenums:0'>Is required</pre> if it can have a null value?<br />
<br />
However, to assign any values including null to report parameters, you can do something like <pre class='_prettyXprint _lang-auto _linenums:0'>params["paramName"] = value</pre> in the scripts tab.<br />
<br />
regards<br />
Arpan