Jaspersoft BI Tools

iReport,Jaspersoft Design Studio,Jaspersoft Server, Schema Workbench,Analysis,Dashboards, Self Service BI, Domains,Topics,Ad-Hoc Reports, Jaspersoft ETL, Embedding BI,HTML-5 charts, Fusion Charts,JFree Charts,Drill down reports , Drill down Dashboards,Visualize.js, Performance Tuning, D3 Charts, Jaspersoft Customization

Tuesday, May 14, 2013

Date Parameters in iReport Designer OR Date Input Controls in JasperServer Repository


Generally we deal with date input controls in our reports...

Here is the stuff related to date input controls..

* Parameters in iReport Designer are called as input controls in JasperServer Repository.
* Generally we use start_date and end_date (OR) from_date and to_date.

start_date: 




Give the properties as shown in the figure:
Name: start_date
Parameter Class : java.util.Date
Use as a prompt : Check this box
Default Value Expression : new SimpleDateFormat("yyyy-MM-dd").format(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
Description : Write your description
Properties : Add properties if you want any in your report parameter.

NOTE:  In Default Value Expression we are taking the start date as one week back from the current date. i.e, from current date to 7 days back.

end_date: 

* As shown in figure we are giving Default Value Expression as Current date. i.e, new Date() function brings out current date(i.e, todays date).


NOTE: 
* The names of the parameters and ID's of the input controls in jasperServer repository should match one another.
  i.e, parameter names in Report Designer = ID's in input controls  of JasperServer Repository 



Useful other posts:



Thanks ...
Have fun with date input controls :) :) :)