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)
Listbox casscading parameter
angrishman
Hi..
I have used cascading parameter in my report.In last drildown option I put the multi select option to "True".
Now I have to pass this multiselect parameter in form of comma seprated value to "Procedure" Parameter.
I have used Procedure because it's conditional based.
So is it possible to pass this multi select parameter to "Stored Procedure."
Kindly Suggest.
Find more posts tagged with
Comments
mwilliams
In the dataSet that you're wanting to use this, just edit your stored procedure using the queryText property in the beforeOpen method. To pass the value as a comma separated list, you'd just join the parameter values like:
params["myParam"].join(",");
angrishman
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="108255" data-time="1344360049" data-date="07 August 2012 - 10:20 AM"><p>
In the dataSet that you're wanting to use this, just edit your stored procedure using the queryText property in the beforeOpen method. To pass the value as a comma separated list, you'd just join the parameter values like:<br />
<br />
params["myParam"].join(",");<br /></p></blockquote>
<br />
<br />
<br />
<br />
Hi William,<br />
<br />
I have implemented it like mentioned below-<br />
<br />
<strong class='bbc'>On "beforeOpen" Event of the DataSet--</strong><br />
<br />
<br />
"<br />
<br />
importPackage(Packages.java.io)<br />
<br />
valStore="";<br />
var parameterArray = reportContext.getDesignHandle().getAllParameters();<br />
var sParName = parameterArray.get(3).getFullName(); <strong class='bbc'>// My third parameter is Multiselect listbox(Store)</strong><br />
strParamValsSelected=reportContext.getParameterValue(sParName);<br />
<br />
if (strParamValsSelected.length > 0 ) <br />
{<br />
for (i = 0; i < strParamValsSelected.length-1; i ++ )<br />
{<br />
if(valStore="")<br />
{<br />
valStore = reportContext.getParameterValue(sParName)
;<br />
}<br />
else<br />
{<br />
valStore=valStore+","+reportContext.getParameterValue(sParName)
;<br />
}<br />
<br />
}<br />
<br />
}<br />
params["prmstore"]=valStore;<br />
this.setInputParameterValue("prmStoreId",params["prmstore"]);<br />
<br />
<br />
<span style='color: #FF0000'>But the problem in the above code is that it is looping through all the Items in the ListBox but what i require only selected value of that store.</span><br />
<br />
<strong class='bbc'>so i have to populate only selected values of the listbox items.</strong><br />
<br />
<br />
Kindly suggest or correct me if i missed something in the above code.<br />
<br />
Regards,<br />
Sumit sharma
mwilliams
You could put a static value into your stored procedure query, in the dataSet editor and then in your beforeOpen script, do something like:
this.queryText = this.queryText.replace("myStaticValue",params["myMultiSelectParam"].join(","));