Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to use Parameter with ListBox to pass multiple entry(data set with query in case of IN(multiple
james_suthanai
<p>Hi All I have a requirement about when client wants to select Branch of the parameter(List Box), So client can select any Branch or select All to see all of them for the report, for now we use data set with the query and use statement like "Select * from table where column in (?)" in this case i define the parameter of List Box in case of All(Value is A,B,C,D) so in this case we expect the result like : "Select * from table where column in (A,B,C,D)" as i try to test the query in the DB is working fine but when i try to run this case on the report it i'not working <br>
Step that i have modified</p>
<p>- for the query Like : Select * from table where column in (?)</p>
<p>- for the parameter that i have created is List Box and the value is : A,B,C,D</p>
<p>- for the parameter the i get to pass in the query is : params["Branch"].value</p>
<p> </p>
<p>So ,Do you have any help with this case?</p>
<p>Thanks</p>
Find more posts tagged with
Comments
CodeRookie
<p>When dealing with string values, I believe you have to put them in single quotes..... i.e. 'A','B','C','D' when setting up the values for the parameter to pass in. I could be wrong on this, as I've only ever dealt with passing numeric values in for parameters. </p>
<p> </p>
<p>Have a great day!</p>
<p> </p>
<p>Scott</p>
shamo
<p>If your Branch isn't dynamic and they are just ABCD, try this. In your parameter, select static and then new, add All, then your ABCD.</p>
<p>then in the filter tab in the datasets, add this on the first fx window.</p>
<p>if(parameter =='All') true else if(parameter == branch field) true else false. then in the drop down select is true.</p>
<p> </p>
<p>hope it helps</p>
Matthew L.
<p>Check out this post for an example report that demonstrates a multiple value list box that shows off both integer list box values and string list box values:</p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/36152-filters-not-adequate-for-large-data-what-then/?p=133966'>http://developer.actuate.com/community/forum/index.php?/topic/36152-filters-not-adequate-for-large-data-what-then/?p=133966</a></p>
;
<p> </p>
<p>The trick in the example is to do a queryText replacement in the data set beforeOpen script method.</p>
james_suthanai
<blockquote class="ipsBlockquote" data-author="CodeRookie" data-cid="145694" data-time="1477651601">
<div>
<p>When dealing with string values, I believe you have to put them in single quotes..... i.e. 'A','B','C','D' when setting up the values for the parameter to pass in. I could be wrong on this, as I've only ever dealt with passing numeric values in for parameters. </p>
<p> </p>
<p>Have a great day!</p>
<p> </p>
<p>Scott</p>
</div>
</blockquote>
<div> </div>
<div> </div>
<div>Thanks for your support, but i try to do for the put for the single quotes on my value to pass in the parameter of the data set then i try to run the report but it still</div>
<div>not working i'm not sure with your point about type of the values in the parameters may be it not working with String. </div>
<div> </div>
<div>
</div>
<div>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">If your Branch isn't dynamic and they are just ABCD, try this. In your parameter, select static and then new, add All, then your ABCD.</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">then in the filter tab in the datasets, add this on the first fx window.</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">if(parameter =='All') true else if(parameter == branch field) true else false. then in the drop down select is true.</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">hope it helps</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </p>
<div>i think the report need to set the query in initial for the first time, So that mean i need to set cause(where clause) with the value of the parameter to append in the query to run the report</div>
<div>and i try to set the query in query text in the data set to check the condition but it's not working.. </div>
<div>
</div>
<div> </div>
</div>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Check out this post for an example report that demonstrates a multiple value list box that shows off both integer list box values and string list box values:</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"><a class="bbc_url" href="
http://developer.actuate.com/community/forum/index.php?/topic/36152-filters-not-adequate-for-large-data-what-then/?p=133966"
; title="">
http://developer.act...-then/?p=133966</a></p>
;
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">The trick in the example is to do a queryText replacement in the data set beforeOpen script method.</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </p>
<div>For this point it seem like difference with my question because i need to select all branch to pass like a 'a','b','c' to append with the query</div>
<div>not select multivalue like your example, but i thank for your support</div>
shamo
<p>Check this report I found on this forum. Don't remember who did it to acknowledge but was in this forum. The second is by Clement</p>
Matthew L.
<p>shamo,</p>
<p>FYI: The first example "select all parameter.rptdesign" was created by Mica via this post: <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/37039-how-to-skip-second-param-based-on-first-param-value/?p=138235'>http://developer.actuate.com/community/forum/index.php?/topic/37039-how-to-skip-second-param-based-on-first-param-value/?p=138235</a></p>
;
shamo
<p>Thanks Matthew L.</p>