How to add the current date to a report

Version 4

    Verified Product Versions

    LANDESK Management Suite 9.0 and Older

    Environment:  LDMS 8.7 and 8.8

    N.B: This feature is available in LDMS 9.5 and 9.6 by default


    Description

    This article describes how to add the current date/time stamp to a report. By default the current date will display on all custom reports in the lower right hand corner of the report. However, if you open the report design and save the design, the report date will no longer be dynamic. It will always be set to whatever the date was when the report design was saved.

     

    Solution

     

    1) Open the report properties of the custom report, then click on Design...

    2) Create a new (or use an existing) TextBox control.

    3) Select the TextBox control, and edit the DataField (under the Data section) with the following text:

     

    =System.DateTime.Now.ToString()

     

    4) Ignore the warning titled "Missing Data Fields" that displays the above string in red text.

     

    5) Save the report design, click OK, and then run the report.

     

    You may not want the exact date/time format that this provides. If you want to customize the format, you can use the following formatting options:

     

    yyyy MM dd hh mm ss

     

    For example, if you wanted to display the current date with a 4 digit year, followed by a 2 digit month, and a 2 digit day, with a "/" between each date element, without showing the time, you would customize the above function like this:

     

    =System.DateTime.Now.ToString("yyyy/MM/dd")