Upgrading mailout report to work with new database design