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)
Displaying selected parameters in the body of a report
nelsont
I have a report where a users needs to select one or more values from a list to run the report against. I would like to display the values that the user selected in the actual report.
I figured out how to display a parameter when there is only a single value that can be entered,
but I can't figure out how to do it with a list of parameters.
I have been searching and it looks like I need to write a script in the OnFetch of the dataset that builds the list of values that the users choose from, but I am clueless when it comes to Java. Any help would be appreciated.
Find more posts tagged with
Comments
RichT
Hi,<br />
<br />
You may have seen this example (<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1305-display-multiselect-parameter-display-text-in-report/'>example</a>)
posted by mwilliams. I'd recommend downloading & using it for reference - I think its what you're looking to do.<br />
<br />
One way to access the correct event (initialize, onFetch, etc) of a report item where you can add JavaScript is to select the report item in the Outline view (Window-->Show View-->Outline) and then select the Script Tab. <br />
<br />
Select the filename.rptdesign (whatever your report is named) in Outline and then select the Script tab. Then add <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>selectedParams = params["NewParameter"].value.join(",");</pre> <br />
Make sure 'NewParameter' is the name of your parameter and that you're in the 'initialize' script event. After that you can reference selectedParams in a Dynamic Text report item (as an example) using the Expression Builder.<br />
<br />
Hope that helps,<br />
Rich
nelsont
Thanks for your reply. It led me to fixing the problem. I had actually seen that example and that was part of the problem - there was a script in the dataset itself to display a name on the report by joining an id number in the dataset. This led me to believe that there was a script required in the dataset itself.
After reading your simple instructions I realized all I needed was what you were laying out. It worked great, thanks very much.