Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Cascade Parameter Help
JavaNep
Hi I have attached the following image for my requirement . If u look at the image there is a cascaded parmeter p_service order type and P_subtype:
What I want to achieve is once the p_service order is checked the respective P_subtype value should populate in the p_subtype list box not FROM DATASET but hardcoded value of p_subtype in script, according to selected p_Service type.
How can I Do this . Is there any other way ?
i tried sending global persistentVariable from initialize script to defaulValue list of the subtype param. but it gets null .
Please help!
Find more posts tagged with
Comments
Hans_vd
Hi,<br />
<br />
You could create a scripted data set that reads the p_service parameter value and hard code some values in an array, and then bind that scripted data set to the report parameter p_subtype.<br />
<br />
Just an example of how the scripted data set should look like (didn't test it):<br />
in the open put code like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>subtypes = [];
if (params["p_service"]=="Service1") {
subtypes[0] = "A";
subtypes[1] = "B";
subtypes[2] = "C";
}
else if (params["p_service"]=="Service2") {
subtypes[0] = "D";
subtypes[1] = "E";
}
idx=0;</pre>
<br />
then in the fetch put code like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if (idx < subtypes.length) {
row["subtype"] = subtypes[idx];
idx++;
return true;
}else{
return false;
}</pre>
<br />
Regards<br />
Hans
JavaNep
Thanks Han , You are a savior. I am brand new bee with this BIRT . If u can attach a simple example. I would be very very thankful to you. <br />
Coz I still havent got the total concept . Thanks Again <br />
<br />
<blockquote class='ipsBlockquote' data-author="'Hans_vd'" data-cid="113356" data-time="1358437510" data-date="17 January 2013 - 08:45 AM"><p>
Hi,<br />
<br />
You could create a scripted data set that reads the p_service parameter value and hard code some values in an array, and then bind that scripted data set to the report parameter p_subtype.<br />
<br />
Just an example of how the scripted data set should look like (didn't test it):<br />
in the open put code like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>subtypes = [];
if (params["p_service"]=="Service1") {
subtypes[0] = "A";
subtypes[1] = "B";
subtypes[2] = "C";
}
else if (params["p_service"]=="Service2") {
subtypes[0] = "D";
subtypes[1] = "E";
}
idx=0;</pre>
<br />
then in the fetch put code like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if (idx < subtypes.length) {
row["subtype"] = subtypes[idx];
idx++;
return true;
}else{
return false;
}</pre>
<br />
Regards<br />
Hans<br /></p></blockquote>
JavaNep
I did created a scrpited datasource and dataset and followed ur instruction one quick question.:<br />
<br />
on This: if (idx < subtypes.length) {<br />
<strong class='bbc'>row["subtype"]</strong> = subtypes[idx];<br />
idx++;<br />
return true;<br />
}else{<br />
return false;<br />
}<br />
<br />
row["subtype"] = is it the name of the parameter or name of the dataset row where it is being used ?<br />
<br />
2nd question:<br />
when I am giving value to the parametr and using the script dataset I just created It does not give me option to see the attached image :<br />
<br />
An example wd definately clear it out but if u can explain these i can atleast move further . Apreciate ur help <br />
<br />
<blockquote class='ipsBlockquote' data-author="'Nuraz'" data-cid="113359" data-time="1358437899" data-date="17 January 2013 - 08:51 AM"><p>
Thanks Han , You are a savior. I am brand new bee with this BIRT . If u can attach a simple example. I would be very very thankful to you. <br />
Coz I still havent got the total concept . Thanks Again<br /></p></blockquote>
Hans_vd
Hi Nuraz,
Here's a sample report that uses the classicmodels database:
JavaNep
Thanks HAN its solved ..<br />
<br />
<blockquote class='ipsBlockquote' data-author="'Hans_vd'" data-cid="113381" data-time="1358496619" data-date="18 January 2013 - 01:10 AM"><p>
Hi Nuraz,<br />
<br />
Here's a sample report that uses the classicmodels database: