That seems to work as well in the end, but I also tried another way with a wrap-run hook and a post-summary hook, which imho is much simpler
pre-report could also be useful