moved a function to report_helper.php