Pierre/reports

Still needs testing, but I'd love a first look @martinrhoads