locked
Displaying image on RDLC report from Azure blob storage RRS feed

  • Question

  • User1416060378 posted

    Please provide me some help on below:

    We are facing problem to display image on Rdlc report from Windows Azure Blob Storage where we need to pass image url as a parameter.
    We have used External as Image Source and provided the expression as follows:
    =Parameters!ImageParam.Value
    Where in ImageParam is parameter.
    Here is code snippet to display image on Rdlc report:-
           BlobHandler bh = new BlobHandler("clientimages");
                List<string> lstBlob = new List<string>();
                lstBlob = bh.GetBlobs();
                string imageName = lstBlob[0].ToString();
                
                ReportViewer1.ProcessingMode = ProcessingMode.Local;
                ReportViewer1.LocalReport.EnableExternalImages = true;

                ReportViewer1.LocalReport.ReportPath = Server.MapPath("ShowImage.rdlc");

    string imgPath = @"http://127.0.0.1:10000/devstoreaccount1/clientimages/flower.jpg";   //@"file:///127.0.0.1:10000/devstoreaccount1/clientimages/flower.jpg";

                ReportParameter[] parameters = new ReportParameter[1];
                parameters[0] = new ReportParameter("ImageParam", imgPath, true);

                ReportViewer1.ProcessingMode = ProcessingMode.Local;
                
                ReportViewer1.LocalReport.SetParameters(parameters);

                ReportViewer1.LocalReport.Refresh();

    Monday, October 26, 2015 2:05 AM

Answers

  • User-646145796 posted

    Hi,

    If you encounter issue when display the image, I would suggest you download Azure Storage Explorer: https://azurestorageexplorer.codeplex.com/, then check the blob container Security in Azure Storage Explorer, like the following, make sure your blob container in a public mode.

    Best Regards,

    Jambor

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 26, 2015 10:30 PM