US and Worldwide: +1 (866) 660-7555
+ Reply to Thread
Results 1 to 4 of 4

Thread: Current Date Function Issue

  1. #1

    Default Current Date Function Issue

    Hello,


    I found that the function that can be used to display the current date is “DateCutExpression”. This option in the Report Designer cannot be invoked. Is there any approach to display the current date?

    Since I have to design reports with the current date in it, which is mandatory I need your assistance.

    Any kind of assistance will be appriciated.
    Thanks in advance.

    Regards,
    Ganga
    Thanks and Regards
    Gangadhar

  2. #2
    Join Date
    Apr 2006
    Posts
    125

    Default Re:Current Date Function Issue

    Hi,

    In my report I use a BSHExpression with this code :
    Code:
    getValue(){
      return new Date();
    }
    then I create a DateField to display it.

    Hope that help,

    Greg.

  3. #3
    Join Date
    Mar 2003
    Posts
    5,974

    Default Re:Current Date Function Issue

    Hi,

    JFreeReport provides an internal report property for that. Just declare a report property named "report.date" and JFreeReport makes sure, that this one contains the correct date/time.

    That internal time is set exactly once per report run, so that the date does not change. The BSH-Solution (or any other expression returning a new date every time) has the disadvantage, that the returned date (as it is based on the current system time) changes slightly every time it is returned).

    Regards,
    Thomas
    Why not listen to the Tales from the reporting crypt.

  4. #4

    Default Re:Current Date Function Issue

    Hi Thomas,
    I read the solution you posted regarding the Current Date. I tried the option you mentioned. It worked. Can I use the "report.date" to display the current date in all my reports that I need to design?

    Thanks for the suggestion.

    I have some more queries for which I might need some assistance. I might post those queries when I ecounter them.
    Expecting the same support and co-operation.

    Thanks,

    Regards,
    Ganga
    Thanks and Regards
    Gangadhar

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts