Jump to content

I\'m lost!! How do I preset an input parameter


dknutson

Recommended Posts

I need to have a date parameter that will default to yesterday.  I've read a number of post on creating custom input controls, and I've dug into the DefaultParametersForm.jsp.  I've even purchased the latest version of the Jasperserver Ultimate Guide.  I'm just not getting it.  Does anyone have a form sample that set's a default date?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

That's how to change it in the report using iReports.  I need to know how to do this in the input control.  What I actually will need later on is much more involved than a simple default date, but I thought that figuring out how to set that in the input control would be a good place to learn how to make a custom input.

Link to comment
Share on other sites

  • 2 weeks later...

Sounds like you are just starting out. Let's say you add an input control with an ID of MY_INPUT_CONTROL. You'll then need to create a parameter with the name "MY_INPUT_CONTROL". Jasper somehow figures out that these two match up.

Then, in the default expression for the parameter I think you can just put "new Date()" if you are using the single input control with a Date data type. Even if your input control is a type of Text, you should be able to put "new Date().toString()" as the default expression.

Since Jasper matches up your parameter and your input control, your input control will get the value of the default expresison. Hope that makes sense, but that's how it works.



Post Edited by rault at 04/23/2012 20:28
Link to comment
Share on other sites

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...