Backport of subreport bugfix from version70 branch