[]
        
(Showing Draft Content)

Time Zone Setting

This section will cover the following scenarios for the time zone setting:

Transform the date to the specified time zone by using UserContext.ToUserTZ() function

You can transform the date to the specified time zone (set in the profile setting) by using UserContext.ToUserTZ() function from the expression editor under Miscellaneous.

Example: In this example, we will use the UserContext.ToUserTZ() function and update the date time field in the report according to the Time Zone set in the admin portal.

  1. Create a report with a DateTime field. We have taken SaleDate as the date time field in this example.

    SaleDate Field


  2. Preview the report.

    Report Preview 1


  3. Click the Data Binding option and select the Expression option.

    Select Expression option


  4. In the Expression Editor, add the following expression by selecting the UserContext.ToUserTZ() function under Miscellaneous and click Save.

    Add Expression


  5. Set the Time Zone in the user profile settings. In this example, we have selected (UTC-9.30) Marquesas Islands.

    Time Zone selected


  6. Now preview the report again. The report date time field SaleDate will be displayed according to the time zone settings.

    Report Preview 2

Auto-generate calculated fields with user time zone

If the property Auto-generate calculated fields with user time-zone is set to True in the Report Designer Settings by the admin, then the calculated fields transformed to user time zone are auto-generated for Date and DateTime fields of embedded and Server datasets. The Time zone set for the user directly works on the calculated fields without using an expression.

Example: If on the Admin portal, the property Auto-generate calculated fields with user time-zone in the Report Designer Settings is set to True.

New Property in Report Designer

Then on the Report Designer, on binding the dataset, the new calculated fields are added in the dataset for date or datetime fields as shown below.

New Calculated Fields Added