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

How to perform date validations in jasper server?


daad.madhusudan

Recommended Posts

I am working on a jasper report which takes two input date parameters from user as START_DATE and END_DATE.

 

I want to put validations on these dates like:

 

1) END_DATE should not be less than START_DATE   

2) START_DATE should not be greater than END_DATE   

3) END_DATE should be max upto 30 days after START_DATE (difference between START_DATE and END_DATE) should be max 30 days

 

 Does anyone know how to to it using ireport? Or is there any alternative way to achieve this in jasper server?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Make use of the Print When Expression property.

 

You could add a Static Text field to the title band of your report that has some like "Start Date must be before End Date". Then set the Print When Expression to be something like $P{START_DATE}.after($P{END_DATE})

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