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 get MultiSelect Parameter in cascading parameters ?
srinivast
Hi,
Can anyone please let me know How we can get multiselect parameter in cascading parameter list?
For Ex: I have 2 parameters
1.Country
2.State
If i select first parameter Country and second parameter automatically load the corresponding states. I have achieved this one by using Cascading parameter.
But, here i am unable to get the state parameter as multiselect parameter
Kindly help to make state parameter as multiselect.( I am BIRT 2.5.1 version)
Thanks,
Srinivas
Find more posts tagged with
Comments
mwilliams
Hi Srinivas,
It looks like the option to select multiple values for a cascading parameter didn't come along until BIRT 2.5.2.
prachi
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68505" data-time="1284664635" data-date="16 September 2010 - 12:17 PM"><p>
Hi Srinivas,<br />
<br />
It looks like the option to select multiple values for a cascading parameter didn't come along until BIRT 2.5.2.<br /></p></blockquote>
<br />
Hey I did select scalar type as multiple and its displaying multiple selection for all levels in cascading. But how to reflect the data in second level if I select more than 2 values in the first level cascading.<br />
Please guide me.<br />
<br />
Thanks Prachi
mwilliams
Hi Prachi,
Can you explain your issue in a little more detail? I'm not quite sure I'm understanding correctly.
prachi
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68661" data-time="1285157678" data-date="22 September 2010 - 05:14 AM"><p>
Hi Prachi,<br />
<br />
Can you explain your issue in a little more detail? I'm not quite sure I'm understanding correctly.<br /></p></blockquote>
<br />
<br />
Hi,<br />
<br />
just take an example. Suppose I have 2 cascading parameters one is Country and second is States. When we select one country from the drop down list then only corresponding states are populated in states dropdown. But I have a requirement like I need to select more than one country and all corresponding states should reflect on the states dropdown. As per your suggestion on the above I used scalar type as multiple type. Its allowing me to select multiple values in country drop down but its not reflecting all values on state drop down, if I select 2 states [us and India] at a time then only US states are reflecting in states dropdown, its not reflecting the second country as India. It just taking the country whichevere selected first. So please guide me how can I reflect all the states from all the countries slected in country dropdown.<br />
<br />
Thanks
mwilliams
Ok, I understand now. What is your BIRT version? I'll take a look.
sdgpub
Hello,<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68505" data-time="1284664635" data-date="16 September 2010 - 12:17 PM"><p>
Hi Srinivas,<br />
<br />
It looks like the option to select multiple values for a cascading parameter didn't come along until BIRT 2.5.2.<br /></p></blockquote>
<br />
In Birt 2.3.2, I have developed a script to load several multiple values in SQL:<br />
the start of the SQL:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
SELECT a.user_name, a.activity_date as ACTIVITY_DATE, a.time_spent as TIMESPENT
, coalesce (project1.code, coalesce (project.code, '(Hors Projet) ')) as PROJECT_CODE
, coalesce ((coalesce (taskp.name || ' > ' , '') || task.name), coalesce (actyp.name || ' > ' , '') || acty.name) as TASK_NAME
, task.type as TASK_TYPE
FROM nqi_cpac_activity a
left join nqi_cppj_project project1 on a.project_id = project1.id
left join nqi_cppj_task task left join nqi_cppj_project project on task.project_id = project.id on a.task_id = task.id
left join nqi_cppj_task taskp on taskp.id = task.parent_id
left join nqi_cpac_activity_type acty on acty.id = a.type_id and (a.project_id is null AND a.task_id is null )
left join nqi_cpac_activity_type actyp on actyp.id = acty.parent_id
WHERE a.activity_date >= ? AND a.activity_date <= ?
AND a.time_spent > 0
</pre>
<br />
and the script which creat the end of the SQL: [To set in the SQL "Before Open"]<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var reqCP = "";
var reqPrj = "";
var reqTAct = "";
var sep = "";
var tmp = "";
if (params["ListeProjet"] != null && params["ListeProjet"].value != null) {
if (params["ListeProjet"].value.length > 1) {
for (var i=0; i < (params["ListeProjet"].value.length-1); i++)
tmp += params["ListeProjet"].value[i] + "', '";
tmp += params["ListeProjet"].value[(params["ListeProjet"].value.length-1)] + "";
reqPrj = " (a.task_id in (select id from nqi_cppj_task where project_id in ('" + tmp + "')) or a.project_id in ('" + tmp + "'))";
}
else {
if (params["ListeProjet"].value.length == 1) {
tmp += params["ListeProjet"].value[0];
reqPrj = " (a.task_id in (select id from nqi_cppj_task where project_id = '" + tmp + "') or a.project_id = '" + tmp + "')";
}
}
}
tmp = "";
if (reqPrj != "") { sep = " OR"; }
if (params["ListeCP"] != null && params["ListeCP"].value != null) {
if (params["ListeCP"].value.length > 1) {
for (var i=0; i < (params["ListeCP"].value.length-1); i++)
tmp += params["ListeCP"].value[i] + "', '";
tmp += params["ListeCP"].value[(params["ListeCP"].value.length-1)] + "";
reqCP = sep + " coalesce (project1.in_charge_of_login,project.in_charge_of_login) IN ('" + tmp + "')";
}
else {
if (params["ListeCP"].value.length == 1) {
tmp += params["ListeCP"].value[0];
reqCP = sep + " coalesce (project1.in_charge_of_login,project.in_charge_of_login) = '" + tmp + "'";
}
}
}
tmp = "";
if (reqPrj + reqCP != "") { sep = " OR"; } else {sep = "";}
if (params["ListeTypeActi"] != null && params["ListeTypeActi"].value != null) {
if (params["ListeTypeActi"].value.length > 1) {
for (var i=0; i < (params["ListeTypeActi"].value.length-1); i++)
tmp += params["ListeTypeActi"].value[i] + "', '";
tmp += params["ListeTypeActi"].value[(params["ListeTypeActi"].value.length-1)] + "";
reqTAct = sep + " acty.id IN ('" + tmp + "')";
}
else {
if (params["ListeTypeActi"].value.length == 1) {
tmp += params["ListeTypeActi"].value[0];
reqTAct = sep + " acty.id = '" + tmp + "'";
}
}
}
if (reqPrj + reqCP + reqTAct != "") {
this.queryText += " AND ( " + reqPrj + reqCP + reqTAct + " )";
}
else {
if (params["ThisProject"].value) {
reqPrj = " (a.task_id in (select id from nqi_cppj_task where project_id = '" + params["projectId"].value + "') or a.project_id = '" + params["projectId"].value + "')";
this.queryText += " AND ( " + reqPrj + " )";
}
}
this.queryText += " ORDER BY a.user_name, PROJECT_CODE, TASK_NAME, a.activity_date";
</pre>
<br />
If it can help you.<br />
<br />
Steph