Fix sql query in printer report. closes #2467