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)
Exception Parameter
kanxabd
hi,
I have a problem: my parameters are dates, a date when step
wrong, raise an exception. I need to catch this exception and not let
the fabric of BIRT exception appears to the user.
how is it possible?
I tried to create a script to validate, but it's nowhere to validate, as triggers exception.
thanks
Find more posts tagged with
Comments
Virgil Dodson
If you need to do some validation on date parameters, you could build your own JSP page to collect the paremeters and run whatever kind of JavaScript you need to do.
cypherdj
In java, you could simply execute the validateParameters method on the run or run and render task, as shown below, to check if your parameters are correct:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
IRunAndRenderTask rrTask = reportEngine.createRunAndRenderTask(reportDesign);
//set render options omitted
rrTask.setParameterValues(parameters);
if (!rrTask.validateParameters()){
// some parameter is invalid, you might be able to use rrTask.getStatus(), not sure
} else {
rrTask.run();
}
</pre>
<br />
But as Virgil suggested, you really should have parameter validation built into your jsp though ;-)<br />
<br />
I hope this helps,<br />
Cedric