To start adding variables in a report first activate the Properties Window Pane.
Next click in the blue part, just below the RULER bar.
This will open the REPORT Properties Pane. At the bottom you see the Variables section.
Using it in your report goes like this.
Result is a count down of Row Numbers.
Easy if you know where to look for ?!
And now add some easy code to your report.
Add the expression in the report.
Look at the result