copied from the reports ui