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)
default parameter value from messages.properties
julisonne
Hello,<br />
<br />
I have following problem:<br />
<br />
My report has several report parameter (Address1, Address2, Address3...). The parameters are required. Normally I will get the value of the parameters from my application but if not I want to set a default address.<br />
<br />
The default address values are located in my messages.properties (Address1=Mustermann GmbH). Now how can I use the value from the property file as default value of the parameter?<br />
<br />
I tried something like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>params["Address1"].value = reportContext.getMessage("Address1", reportContext.getLocale());
</pre>
<br />
But it doesn't work. I'm new in Scripting so I hope you can help me...
Find more posts tagged with
Comments
mwilliams
First, make sure you have the properties file listed as a resource for your report, in the property editor. Then, put this as the default value expression, in the parameter editor:
reportContext.getMessage("Address1", reportContext.getLocale());
That should fill the default of the parameter to the value in your properties file. It worked for me, in BIRT 4.2.
julisonne
Hello,
I tried it and it worked.
Thank you.^^
mwilliams
You're welcome. Let us know whenever you have questions!