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

Facing problems creating Input-Control Parameters


Go to solution Solved by mbmorgan,

Recommended Posts

Hi Folks,

I am facing problem creating parameters. I need to create one date Input-control which will be in relation like (from date - to date. )

I dont know how to create it's parameter from Jaspersoft studio. I mean for single select query or multi select quey we use $X(IN,Field,Parameter).

So for this kind of input control(from date - to date) what kind of parameters we should use. I am in a big problem please help me out.

 

Thanks in advance......

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

Hi, a few suggestions:

"I need to create one date Input-control which will be in relation like (from date - to date. )" - This sounds like you actually need two date-based input controls, Start_Date and End_Date for example.

In Jaspersoft Studio, make sure the date parameter is of class java.sql.Date.

In JR Server, when you set up and edit the input control, on the "Create Input Control" page, select "Single Value" as the type (make it also Mandatory and Visible if it's necessary to run the report). Then, on the "Set the Datatype Kind and Properties Page", select "Date" as the type. You can enter optional max and min values there.

Your report query should look something like:

"select * from table

where date_column >= $P{Start_Date} and date_column <= $P{End_Date}..."

I am a new Jasper developer and I had this same problem recently. This solution is what worked for me.

Good Luck,

M.B.Morgan

Link to comment
Share on other sites

Hi Morgan,

 

Thanks for the response and the input-controls are working perfectly.

I have done it with your help, but just one problem when the chart executes in the server it comes as an empty report.

After chossing the data from the control the chart poopulates, is there any way to give the controls a default value.

Please help me with this and it will be perfect.

 

Link to comment
Share on other sites

Hi Mallik, I'm not sure I understand your question.

 

"...but just one problem when the chart executes in the server it comes as an empty report. After chossing the data from the control the chart poopulates"

 

- This is by design from when you made the input controls mandatory - the report will not populate in the JR Server until the user actually selects something in the controls for it to work with.

 

Please elaborate on what exactly you want to accomplish.

Link to comment
Share on other sites

I dont want to make the date control as mandatary.I want to have a chart with default dates and we can change our chart by different selection in the date filters. Now I need to know how to set default values for parametrs. So that when the chart gets executed the filters would have default dates in them.

 

Thanks for the help and support Morgan.

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