public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CourseWiseCrystalReport rpt = new CourseWiseCrystalReport();

            rpt.Site = this.Site;
            return(rpt);
        }
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex == 0)
     {
         crystalReportViewer1.ReportSource = null;
     }
     else
     {
         using (con = new SqlConnection(ConStr))
         {
             using (com = new SqlCommand("select * from Student where CourseName='" + comboBox1.Text + "'", con))
             {
                 using (adapter = new SqlDataAdapter(com))
                 {
                     dt = new DataTable();
                     adapter.Fill(dt);
                     CourseWiseCrystalReport cwr = new CourseWiseCrystalReport();
                     cwr.SetDataSource(dt);
                     crystalReportViewer1.ReportSource = cwr;
                 }
             }
         }
     }
 }