ReportDocument rpt = new ReportDocument(); rpt.Load(Server.MapPath("ReportEngine.rpt")); CrystalReportViewer1.ReportSource = rpt; rpt.SetDatabaseLogon("sa", "123"); ReportDataSet DS = new ReportDataSet(); using (SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["DbConnectionString"])) { con.Open(); string query = "SELECT ID As Column1,NameEn As Column2, NameAr As Column3, Email As Column4, Email As Column5"; SqlCommand cmd = new SqlCommand(query, con); SqlDataAdapter adapter = new SqlDataAdapter(query, con); adapter.Fill(DS, "ReportTable"); rpt.SetDataSource(DS); } string[] cols = { "ID", "NameEn", "NameAr", "Email", "Email" }; for (int i = 0; i < cols.Length; i++) { rpt.SetParameterValue(i, cols[i].ToString()); } CrystalReportViewer1.ReportSource = rpt;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)