New to Telerik ReportingStart a free 30-day trial

Retrieving Previous Record in Detail Section

Description

I want to display the previous record in the detail section of my Telerik Reporting report. Using the Previous function directly in the detail section does not allow retrieving the previous group's value, because the function requires an explicit scope to be evaluated. I need this functionality to manipulate the data starting from the second record.

Solution

To achieve this functionality, use the Previous function. It allows retrieving values from the previous record or group within the detail section by specifying the appropriate scope.

  1. Use the following expression to get the previous group's value:

    = Previous("group", Fields.Column1)

    Replace group with the name of your group and Fields.Column1 with the field you want to retrieve.

  2. To avoid displaying an empty value for the first record, use the IsNull function. This ensures a default value, such as 0, is shown for the first record:

    = IsNull(Previous("group", Fields.Column1), 0)

Notes

  • Ensure the group name passed as the scope argument to the Previous function matches your report design.

Sample Report

See Also