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)
Get the Display Text from a Report Parm (combobox, listbox, radio button)
TheRealDea
If I am wanting to show the "Display Text" from a report parm(combobox, listbox, or radio button), how do I go about that? Say I am wanting to set my display variables from the beforefactory event, can I push the text from the report parm into a dynamic text control?
Find more posts tagged with
Comments
mwilliams
Hi TheRealDea,
By "display text", you mean like the question that is asked of the user, correct? Or do you mean the user's response?
TheRealDea
Whenever you create the combobox or listbox report parm, you have the value and the display text. The display text that is tagged with the value within the report parm control, is the verbiage I would be looking for.
i.e.
Value Display Text
1 January
2 February
3 March
4 April
...
Though I will use value for my query, I would like to show the display text on the report output.
TheRealDea
Any thoughts about how to get this?
mwilliams
TheRealDea,<br />
<br />
In a dynamic text box, I think you should be able to put params["param_name"].displayText and get the display text. However, when I try this in a report design, it just returns the "value". I tried in both BIRT 2.2.2 and BIRT 2.3. Also, in the report:initialize script, there is the option to get the display text with reportContext.getParameterDisplayText("param_name");, but this also just returns the value. I don't know any other way you'd be able to get the display text besides maybe creating your own parameter page. You can log a bug for this at <a class='bbc_url' href='
http://www.eclipse.org/birt/phoenix/reportabug.php'>BIRT
: Reporting Bugs and Requesting Enhancements</a> so you can see the response/track the bug.
TheRealDea
I was able to get this format to work for me.
"Parm: " + reportContext.getParameterDisplayText("parm_name");
mwilliams
Weird. I had tried using it in several different places and always just got the parameter value. Where did you put the script? What version are you using?
mwilliams
Nevermind. I forgot to set the display text, so I was just getting the value by default.
hexadecima
I am having this problem actually:
I have dynamically filled ListBox,
both value and display text fields are set and working properly,
After user selects a couple of items from listbox I want to show them on report. I am able get value of selected items like;
params["myListBox"].value[0...N]
but neither
params["myListBox"].displayText[0...N]
nor
reportContext.getParameterDisplayText("myListBox")[0..N]
works?
This params["myListBox"].displayText or reportContext.getParameterDisplayText("myListBox") returns null ?