Fixed the query string parsing for the report generator