Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Date-time stamp in pentaho reports

  1. #1
    Join Date
    Jun 2006
    Posts
    4

    Default Date-time stamp in pentaho reports

    All,

    I am new to Pentaho. I have installed it and have written a few reports. I got most of the help from the documents and here is something I am unable to locate in the documents (and I did google as well).

    I would like to add date-time to my reports. I have looked at the advanced reporting guide. None of the report sections (including reportheader, reportfooter, pagefooter, or pageheader) carry attributes to turn on date-time (in the version of the document I have). How can I add datetime to my reports?

    Thank you for your help.

    skareti

  2. #2
    Join Date
    Nov 1999
    Posts
    579

    Default Re:Date-time stamp in pentaho reports

    It's there, it's just not very clear. I've sent a note off to the person to amend the document to make it clearer.

    Anyway, here's what you need to do:

    1- In the <functions> section at the top, add a property reference to report.date as follows:

    Code:
      <property-ref name="report.date"/>
    2- Wherever you want the date printed (header, footer, etc.) add a TextFormatExpression like this:

    Code:
    <expression name="expr" class="org.jfree.report.function.TextFormatExpression">
      <properties>
        <property name="pattern">Current Date: {0, date, EEE, MMM d, yyyy}</property>
        <property name="fields[0]">report.date</property>
      </properties>
    </expression>
    I hope this helps,

    Marc

  3. #3
    Join Date
    Jun 2006
    Posts
    4

    Default Re:Date-time stamp in pentaho reports

    Marc,

    Thank you for the response.

    The expression tag is not being recognized under header. Here is what I have for the header.



    Heartbeat Status


    Current Date: {0, date, EEE, MMM d, yyyy}
    report.date




    And belog is the log.

    11:26:49,539 INFO [STDOUT] WARN:
    11:26:49,539 INFO [STDOUT] Unknown tag
    11:26:49,540 INFO [STDOUT] WARN:
    11:26:49,540 INFO [STDOUT] Unknown tag
    11:26:49,540 INFO [STDOUT] WARN:
    11:26:49,540 INFO [STDOUT] Unknown tag
    11:26:49,540 INFO [STDOUT] WARN:
    11:26:49,540 INFO [STDOUT] Unknown tag

    Appreciate your help.

    skareti.

  4. #4
    Join Date
    Jun 2006
    Posts
    4

    Default Re:Date-time stamp in pentaho reports

    All,

    This seemed to work.

    Add the following to report header.



    skareti

  5. #5
    Join Date
    Jun 2006
    Posts
    4

    Default Re:Date-time stamp in pentaho reports

    Sorry, I forgot to paste the code. Apart from adding the property ref
    "" at the top of your functions,
    add the following whereever you need the date...



    skareti.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.