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.
-
Use the following expression to get the previous group's value:
= Previous("group", Fields.Column1)Replace
groupwith the name of your group andFields.Column1with the field you want to retrieve. -
To avoid displaying an empty value for the first record, use the
IsNullfunction. This ensures a default value, such as0, is shown for the first record:= IsNull(Previous("group", Fields.Column1), 0)
Notes
- Ensure the group name passed as the scope argument to the
Previousfunction matches your report design.