public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { StudentsFormReport rpt = new StudentsFormReport(); rpt.Site = this.Site; return(rpt); }
void reportGenerator() { //SqlCommand cmd = new SqlCommand(conn); //DataTable dataTable = new DataTable(); SqlCommand cmd = new SqlCommand("select * from Students", conn); DataSet dataSet = new DataSet(); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(dataSet); //students_dgv.DataSource = dataTable; StudentsFormReport studentsFormReport = new StudentsFormReport(); studentsFormReport.SetDataSource(dataSet); StudentFormReportViewer studentFormReportViewer = new StudentFormReportViewer(); studentFormReportViewer.StudentReportViewer.ReportSource = studentsFormReport; studentFormReportViewer.ShowDialog(); }