Jump to content
We've recently updated our Privacy Statement, available here ×

Dashboard parameter questions/experiments


mpenningroth

Recommended Posts

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,

  Mark

Code:
	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

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

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

  • 3 weeks later...
  • 10 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...