Is there any way or function that IReport Designer allows me to print my server date without any Java class when I print the document.
Is there any way or function that IReport Designer allows me to print my server date without any Java class when I print the document.
If you still use the old iReport you should know that it is obsolete and that since December 2015 it stopped being updated.
It is very clear on the page
iReport
:What the note says is this:
In fact, there is now a much improved design tool over the old iReport designer, it's called Jaspersoft Studio .
I will show various ways to put the current date on any report.
In the palette you have a small widget that is used to put the current date / time. There you have it, it says
Current Date
:You just select it with the mouse and drag it to the part of the report you want:
I have dragged it to the bottom of the page:
Let's see a preview:
We can give it another format if we want. Let's go back to the tab
Design
. We select the field, right click and thenShow Properties
, thenText field
and in the inputPattern
you write this:dd 'de' MMMM 'de' yyyy
or any other valid format desired.Let's see the Preview:
other possibilities
You can directly use Java code in a text field. It's as easy as dragging a
TextField
, double clicking on it and typing for example this in the expression editor that will open:Since version 5.1.2 you can use expressions like
TODAY()
. If you open a text field and simply type:TODAY()
, it will show you the current date, and you can format it like we did before. For more details on this you can see the article titled Custom Functions in Report Expressions .