Inside report print formats, there’s only three variables available for use:
report
data
filters
However, for my case, I have some extra processing I do inside report.py, for the whole dataset, kind of like a summary that I’d want available in the print format or the report page itself.
I’ve used both ‘message’ and ‘report_summary’ in script reports to do something similar to what you’re after. Have a look at [Tutorial] Script Report / Chart