How to snag the report SQL queries from the database