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)
IRunTask and ParameterValidationException
cypherdj
Hi there,<br />
<br />
I've introduced some parameter validation in a report.<br />
<br />
When I execute the IRunTask.run(), it throws a ParameterValidationException. Great stuff, I can handle the error gracefully so my implemented viewer can display the relevant message.<br />
<br />
Now, what I would like to do is to set the error message within the validate function, as at present the message is always "Required parameter <parameterName> is not set", which is not exactly informative to the end user ;-)<br />
<br />
The value is actually set, but the validation fails (eg, date cannot be in the future), and it would be useful for the report designer to set the customise the error message within the validate function, but I cannot figure out how this can be achieved?<br />
<br />
I've tried setting a context property using <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
reportContext.getAppContext().set("reportDate", "Parameter reportDate cannot be in the future");
</pre>
<br />
but this does not seem to be picked up when accessing IReportEngine.getEngineConfig().getAppContext(). The HashMap returned does not contain any "reportDate" entry.<br />
Any ideas?
Find more posts tagged with
Comments
There are no comments yet