Different page header for each line item?

I’m trying to customise the return order report to have a separate page for each return order line, and the page for each line should have the return reason code for that line specifically in the header.

I’ve tried using var-element-value, but if I declare the value inside the list then it just repeats reason code from the last line for each page, and when I declare it on the first page and update it inside the list I get #CONVERSION_ERROR#

because it is very difficult to understand the design of your template without looking at your report template.
I would like to ask you to send the report template to our support for further analysis.

It seems my issue is that I followed the “Using Var and Context Tagging Elements” tutorial wrong by using a page break instead of a section break.

But now I’m having the issue that the last page is still using the variable from the second last page.

I have sent you a private message please could you reply.

Many Thanks