mpenningroth Posted December 11, 2009 Share Posted December 11, 2009 I am using JasperAnalysisPro 3.1.I created a simple report with iReport that has a single string parameter named X.I gave X a default value of "Default X".I added the report to the Server and it runs fine when I invoke it from the repository.I added an input control for X and the report unit is set to always prompt. When I run the report, it displays a box for parameter input (which is initialized to Default X). The input control is not flagged as Mandatory.I then created a dashboard and added this report to it. The system complained with a misleading message:"The report is missing default values for at least one mandatory parameter"There are no mandatory parameters, and the one parameter I have has a default value.I added the input control to the dashboard and I get the same message but the control correctly displays the default value.I played with the "visible" flag and the "always prompt" flag and never got what I wanted. What I want is for the dashboard to display the controls with the default values and run the report.The user could then change the control, press subit and run again.I attempted to change the needsInput method in ReportParametersAction (see below) method with what is in the comments. This stopped the error message but the dashboard always ran with the default value even if I modified the control and hit submit.Note in the code below I replaced the initial return (!wrappers.isEmpty()); with the commented block.Any ideas?Thanks, MarkCode: protected boolean needsInput(RequestContext context, List wrappers) { // mpenningroth 11-DEC-2009 // I think it is weird to get an error that reads: // "The report is missing default values for at least one mandatory parameter" // For a report that has default values for the parms. // Furthermore, the test I did did not have any mandatory parms // This is an attempt to loop through the wrappers and only return true // if the wrapper has no value. May need to add a special check for what state we are // in. return (!wrappers.isEmpty());// if (wrappers.isEmpty())// return false;// else {// Iterator wi = wrappers.iterator();// while (wi.hasNext()) {// RuntimeInputControlWrapper w = (RuntimeInputControlWrapper)wi.next();// if (w.getValue() == null)// return true;// }// return false;// } } Link to comment Share on other sites More sharing options...
swood Posted December 19, 2009 Share Posted December 19, 2009 As you found, this does not look right. It should be raised as a bug. Did you try setting the defaultExpression for the paramter in the JRXML? It is not really a fix for the issue, but it may achieve the effect you are after. ShermanJaspersoft Link to comment Share on other sites More sharing options...
mpenningroth Posted December 21, 2009 Author Share Posted December 21, 2009 I didn't try using the defaultExpression. I think the problem is that the needsInput is being used incorrectly at dashboard initialization. It is correctly determining that input controls should be displayed, but the "true" result is being interpretted in the main flow as an error. I think there needs to be a different action than "checkParams" for the initialization of the dashboard. Ideally you would only get an error if a mandatory parameter does not have a value and it cannot be prompted for. BTW I have also been modifying the dashboard frame code so that if there are controls that map to url parameter values (with the hidden_ prefix), I show the value in the control. Not sure what the meaning of hidden_ is when there is a control, but i couldn't use the parameter value without the prefix. Mark Link to comment Share on other sites More sharing options...
sjongenelen Posted January 7, 2010 Share Posted January 7, 2010 what is the status of this bug? I'd really like to use Reports + parameters in dashboards!!-using jasperserver 3.5 pro Link to comment Share on other sites More sharing options...
bikashmca04 Posted November 18, 2010 Share Posted November 18, 2010 This works for me, as a solution un-check the always prompt check box in input controls.http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=58236 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