fix an error when not filtering a report
simplify the reporting query slightly