Show Image from server path

Posted by: hbkelkar on 3 May 2020, 12:06 am EST

  • Posted 3 May 2020, 12:06 am EST

    Hello,

    I am working on a web application with Active Report (V.11 - Section report)

    Need to show Image from a path on Server on to the image control.

    Can you help me out with code ?

  • Posted 3 May 2020, 12:26 am EST - Updated 30 September 2022, 8:08 am EST

    I am using asp.net web forms and Active Reports 11 Section Report

  • Posted 3 May 2020, 6:26 pm EST

    Hello,

    Please drag and drop the Picture control and use the following code to get the image from the URL in the Format event of the detail section:

    
    WebClient wc = new WebClient();
    byte[] bytes = wc.DownloadData("http://localhost/image.gif");
    MemoryStream ms = new MemoryStream(bytes);
    System.Drawing.Image img = System.Drawing.Image.FromStream(ms);
    Picture1.Image= img;
    
    

    Thanks,

    Mohit

  • Posted 4 May 2020, 7:13 am EST

    Thanks for the code sample… Worked !

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels