cherry-pick from master to 5.0

https://github.com/webdetails/pentaho-platform-plugin-reporting/commit/dab01665009b84a19be691a1429f5ead18198f99