private void button1_Click(object sender, EventArgs e) { try { con.Open(); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = new SqlCommand("execute allProfit", con); DataTable dt = new DataTable(); da.Fill(dt); allProfit myreport = new allProfit(); myreport.SetDataSource(dt); profitView pv = new profitView(); pv.crystalReportViewer1.ReportSource = myreport; pv.Show(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "errorr!", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { con.Close(); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { allProfit rpt = new allProfit(); rpt.Site = this.Site; return(rpt); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { allProfit rpt = new allProfit(); rpt.Site = this.Site; return rpt; }