public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { Proj_Exp rpt = new Proj_Exp(); rpt.Site = this.Site; return(rpt); }
//dataset 2 private void DataSet2(string qry2) { DataTable table = new DataTable(); MySqlDataReader reader; table.Columns.Add("proj_name", typeof(string)); table.Columns.Add("in_date", typeof(DateTime)); table.Columns.Add("amount", typeof(double)); try { reader = DBConnection.getData(qry2); if (reader.HasRows) { while (reader.Read()) { table.Rows.Add(reader.GetString("proj_name"), reader.GetDateTime("in_date"), reader.GetDouble("amount")); } } reader.Close(); ProjectReports.Proj_Exp report = new ProjectReports.Proj_Exp(); report.Database.Tables["Proj_exp"].SetDataSource(table); crystalReportViewer1.ReportSource = null; crystalReportViewer1.ReportSource = report; } catch (Exception exc) { MessageBox.Show(exc.ToString()); } }