public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CrystalReport5 rpt = new CrystalReport5(); rpt.Site = this.Site; return(rpt); }
private void Form23_Load(object sender, EventArgs e) { con = new MySqlConnection("server=localhost;username=root;pwd=niku2912;database=canteen"); con.Open(); cmd = new MySqlCommand("select * from purchase", con); da = new MySqlDataAdapter(); da.SelectCommand = cmd; DataSet ds = new DataSet(); da.Fill(ds, "prod_code"); CrystalReport5 myreport = new CrystalReport5(); myreport.SetDataSource(ds.Tables["prod_code"]); crystalReportViewer1.ReportSource = myreport; crystalReportViewer1.Show(); }