generating report code