code to grab data for advance reports