Reports internally go through the data set twice, the second run generates the report output. The data set does not (must not) change between the two runs. This makes it possible to use so called delayed or precalculated values. A precalculated expression keeps the value computed for the last row of the data set during the first run. The second run uses this value.
By default, expressions are not precalculated. Let's call non-precalculated expressions and values normal.
Expressions need to be explicitly marked as precalculated. Marking expressions as precalculated is possible via the report XML description, or by the OpenCReports API. See Precalculated value in XML, Section 10.1.4.19, and Section 12.8.25.
OpenCReports allows mixing normal and precalculated values in the same expression. For example, if a normal expression references Precalculated variables, the result would be intuitively expected.