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

Date Parameter in iReport


ktrinad

Recommended Posts

By: SandeepRam - sandeepram

Date Parameter in iReport

2004-11-09 06:00

friends,

 

i m using iReport for designing reports for open reports. Passing parameters through open reports.

I am able to receive the parameters in iReports

for datatype like int,double,string etc..

 

I can manipulate these parametes as follows:

eg:- for integer parameter

$P{emp_id}.intValue()

for double parameter

$P{price}.doubleValue()

 

but the problem comes when a date parameter is passed through open reports

 

i didnt find any method to get the date value.

 

is there any method like $P{date}.dateValue() ?

 

please give a solution ...

 

with regards

 

ram

 

 

By: Tobias Gaekle - ike987

RE: Date Parameter in iReport

2004-11-09 06:21

you can use the SimpleDateFormat class to do date formatting, for example like this:

 

new SimpleDateFormat("dd.MM.yyyy")).format($F{yourDate})

 

if you get the date as a String, you probably need to call the parse function to get a java.util.Date first.

 

API docs:

http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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