IBM Enterprise Records, Version 5.1.2    

Creating a customized report template

The IBM® Enterprise Records product is shipped with more than 41 reports and applies the time zone passed from the IBM Enterprise Records web user interface to these report templates. The IBM Enterprise Records web user interface passes the start date and end date of the report criteria in the Greenwich mean time (GMT) time zone to Crystal Reports.

About this task

The results of the date fields returned from the report query are in the GMT time zone. The date fields in the report output can be displayed with the time zone passed from the IBM Enterprise Records web user interface. The time zone can be configured in the Workplace XT Site Preferences Time Zone setting to a specific time zone. You can create a customized report template in Crystal Reports. You can then apply the time zone passed from the IBM Enterprise Records web user interface to the date fields in the report output.

If you create customized reports and want to apply the time zone to the date fields in the report, you must define the time_zone parameter. You must then create the formula fields for the date fields in the report template. You can make the following types of changes to apply the time zone to the date fields in a report:

Table 1. Example report parameter values
Action Direction
Apply the time_zone parameter to the report execution date For the report execution date in the report title, define a time_zone parameter and change the formula of the execution date field to:
ShiftDateTime (CurrentDateTime, "" ,{?time_zone})
Apply the time_zone parameter to the report with a beginning and ending period in the report title For the report with the start date and end date in the report title, change the formula for the start date and end date to:
ShiftDateTime (DateTime(Left({?start_date},10) + " " + mid({?start_date},12,8)),"GMT,0" ,{?time_zone})
ShiftDateTime (DateTime(Left({?end_date},10) + " " + mid({?end_date},12,8)),"GMT,0" ,{?time_zone})
Apply thetime_zone parameter to the date property For the report with the date property, for example Command.DateCreatedin the report, define a time_zone parameter in the main report and each subreport. Then change the formula for the date property to:
ShiftDateTime ({Command.DateCreated},"",{?time_zone})

Procedure

To apply the time zone to the date fields in the Electronic Records Viewed by a User within a specific period report template delivered with the product:

  1. Start Crystal Reports Designer, open the Detailed Electronic Records Viewed.rpt report template.
  2. On the main report Field Explorer, right-click Parameter Fields and select New to create a parameter.
  3. In Create New Parameter, enter time_zone for Name and select String Type. Select Do not show in the Show on (Viewer) Panel value option.
  4. Open the Formula Workshop and define the date, start, and end fields in the formula with the time_zone parameter:
    • date: ShiftDateTime (CurrentDateTime, "" ,{?time_zone})
    • start: ShiftDateTime (DateTime(Left({?start_date},10) + " " + mid({?start_date},12,8)),"GMT,0" ,{?time_zone})
    • end: ShiftDateTime (DateTime(Left({?end_date},10) + " " + mid({?end_date},12,8)),"GMT,0" ,{?time_zone})
    Save and close the changes.
  5. Open a subreport from the Field Explorer, right-click Parameter Fields and select New to create new parameter.
  6. In Create New Parameter, enter time_zone for Name and select String Type. Select Do not show in the Show on (Viewer) Panel value option.
  7. Open the Formula Workshop and define the DateCreated and DateLastModified fields in the formula with the time_zone parameter:
    • DateCreated: ShiftDateTime ({Command.DateCreated},"",{?time_zone})
    • DateLastModified: ShiftDateTime ({Command.DateLastModified},"",{?time_zone})
    Save and close the changes.
  8. Repeat Steps 5 through 7 for each subreport.
  9. From main report Edit menu, select Subreport Links.
  10. For each subreport, move the time_zone option from Available Fields into Field(s) to link to and select the ?time_zone parameter from Subreport parameter field to use.
  11. Repeat step 10 for each subreport in Subreport Links.
  12. Save this report to the Samples folder under the Crystal Reports installation path.

    C:\Program Files\Business Objects\BusinessObjects Enterprise 12\Samples\en\Reports\



Feedback

Last updated: November 2013
customize_report_template.htm

© Copyright IBM Corporation 2013