customerReport = new ReportDocument(); string reportPath = Server.MapPath("CrystalReport.rpt"); customerReport.Load(reportPath); DataTable newData = new DataTable(); newData.Columns.Add("SNo", System.Type.GetType("System.String")); newData.Columns.Add("Name", System.Type.GetType("System.String")); newData.Columns.Add("Tele", System.Type.GetType("System.String")); newData.Columns.Add("Image", System.Type.GetType("System.Byte[]")); DataRow dr = newData.NewRow(); dr[0] = "Trying once"; dr[1] = "Trying Again"; dr[2] = "Still No Clue"; string picPath = Server.MapPath("EmployeeImage/SomeImage.jpg"); FileStream fs = new FileStream(picPath, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fs); byte[] imgByte = new byte[fs.Length + 1]; imgByte = br.ReadBytes(Convert.ToInt32(fs.Length) ); dr[3] = imgByte; newData.Rows.Add(dr); br = null; fs.Close(); fs = null; customerReport.Database.Tables[0].SetDataSource(newData ); crystalReportViewer.ReportSource = customerReport;
byte[] imgByte = new byte[fs.Length];
customerReport.SetDataSource(newData);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)