I need to insert a picture into report, which is represented as an array of bytes. How can I do this?

Here is how I did:

string path = @"C:\Users\111\Desktop\123.jpg"; string image = ImageToBase64(System.Drawing.Image.FromFile(path),System.Drawing.Imaging.ImageFormat.Bmp ); _reportViewer.LocalReport.SetParameters(new ReportParameter("image", path)); _reportViewer.LocalReport.ReportPath = "..\\..\\Report4.rdlc"; _reportViewer.RefreshReport(); public string ImageToBase64(System.Drawing.Image image, System.Drawing.Imaging.ImageFormat format) { using (MemoryStream ms = new MemoryStream()) { // Convert Image to byte[] image.Save(ms, format); byte[] imageBytes = ms.ToArray(); // Convert byte[] to Base64 String string base64String = Convert.ToBase64String(imageBytes); return base64String; } } 

    1 answer 1

    Here and here , like what you need