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)
show displayText of multiple selected item params
birtUser041882
<p>Hi, I have multi select list and user can select 1 to many items as params. My problem is I don't know how to get teh displayText of each and not the value. </p><p>ex. Country {USA (id=1), India(Id=2), Japan(Id=3) }</p><p> </p><p>I can get the selected values by doing this: </p><p>Dynamic text = params["Country"].value.join("','")</p><p>it will show the id like 1,2,3 if I select All. but how can I get the display text instead? So it will show USA, India, Japan. any idea? thanks</p>
Find more posts tagged with
Comments
kclark
<p>Have you tried something like</p><p> </p><p>params["NewParameter"].displayText</p><p> </p><p>That should pull the value displayed, not the value used in "value column"</p>
birtUser041882
<p>Hi, yes I know that it pulls the text and not the value. It works when the dropdown or listbox is SINGLE select. But my situation is different. It is MULTI selected so It does not work. But I already foudn the solution from <a data-ipb='nomediaparse' href='
http://www.birt-exchange.org/devshare/_/designing-birt-reports/1305-display-multiselect-parameter-display-text-in-report'>here</a> just
that the resource can't be downloaded and shows xml so I had to recreate it by looking at the xml.</p><p>1. add this code to initialize even of report itself</p><p>custList = params["customer"].value.join(",");</p><p> </p><p>2. add this code to the dataset used, event name onfetch. in this case, dsCustomer</p><div> </div><div>if (custList.indexOf(row["id"]) != null){</div><div> custList = custList.replace(row["name"].toString(), "hello");</div><div> }</div><div> </div><div>3. drag a dynamic text and bind it in the dscustomer. type custList in the expression</div><div> </div><div>and there it is.
</div>