Jump to content
Changes to the Jaspersoft community edition download ×

How to create a date in my report


llaconde

Recommended Posts

Hi everybody,

 

I'm new in ireport. I've bougth the documentation but I don't manage to print a date in my report.

I've already manage to print a variable in my report that I have declared in my java class like this:

parameters.put("City", "PARIS");

and in my report creating a "parameter" called $P{City}.

How do I do to do the same with a date?

Thank you in advance.

 

LL

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

Why don't you try something like putting the following in your java code:

parmeters.put("dateParam", new Date())

 

In iReport create a parameter of type java.util.Date and name it "dateParam" (note the case). Then create a Text-Field and set its type as java.util.Date. In the Text-field expression editor select the parameter to be displayed (i.e. $P{dateParam}).

 

Hope this helps.

 

Rahul.

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