leesy84 Posted May 23, 2008 Share Posted May 23, 2008 Hi I have developed a report in iReport using 3 parameters and a jar file i have written. This first parameter is a filename the second a number both of these are prompted for the third parameter isn't prompted for and simply has a default value which is calling a java method i have wrote passing it the filename entered as param1. This all works fine and runs on iReport however when i came to add it on jasperserver i add two controls to my report for filename and the number but don't add the third one as the default value will be picked up from the jrxml file? If i do this it seems to evaluate the thrid parameter before asking me for the filename so i get a filenotfound exception in my jar as it is being passed null. If i add it as a control i can't set the default value, or set the type to java.util.List and also i can also set prompt on all three controls not the individually. I am sorry this is a long post it is my first post and not sure how much detail i need to enter Thanks in advance for any help Cheers Daniel Lees Link to comment Share on other sites More sharing options...
lucianc Posted May 23, 2008 Share Posted May 23, 2008 JasperServer evaluates the default value expression for all parameters in order to provide initial values for the report input control. A solution for your case is to write a default value expression (for the third parameter) that checks whether the first parameter has a value:Code:<parameter name="Param1"/><parameter name="Param2"/><parameter name="Param3"> <defaultValueExpression> $P{Param1} == null ? null : ..your expression.. </defaultValueExpression></parameter> We could change JasperServer to silently ignore exceptions thrown while evaluating parameter default value expressions. If you think this should be done, please log it as a bug [url=http://jasperforge.org/sf/tracker/do/listArtifacts/projects.jasperserver/tracker.bugs]here. Regards,Lucian Link to comment Share on other sites More sharing options...
massimiliano.oreto Posted July 23, 2020 Share Posted July 23, 2020 Doesn't work for me . Parameter 1 inside parameter 3 is always null Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now