External Image not showing

Posted by: jonathan.brower on 13 March 2023, 6:13 am EST

    • Post Options:
    • Link

    Posted 13 March 2023, 6:13 am EST

    I have an image I’m trying to put into the header of a report. I have the image in an Images folder in the root of my project. When previewing the report in Visual Studio the image appears exactly how I want it. However, when I deploy the app on the web, the image link is coming across as url(‘/api/reporting/view/qxdZc-tvxE6KasyzTqojQA/resource/02514334C300E29CF93D9D240C692B638.png’) and the image does not display at all.

    I’m not sure what I’m missing/doing wrong. Any advice?

  • Posted 13 March 2023, 8:04 pm EST - Updated 13 March 2023, 8:11 pm EST

    Hi Jonathan,

    >> However, when I deploy the app on the web, the image link is coming across as url(‘/api/reporting/view/qxdZc-tvxE6KasyzTqojQA/resource/02514334C300E29CF93D9D240C692B638.png’)

    It seems the image is picked up by the reporting API. It is hard to say why the image is not displayed in the browser without being able to reproduce the issue at our end and go through the application once.

    Please share a runnable sample application reproducing this issue or edit the attached sample such that it reproduces the issue and send it back to us so we can test this at our end and get back to you accordingly. And please provide us more detail on how you are deploying the application so we can replicate the deployment environment as well, also share the steps to reproduce the issue.

    If you are unable to reproduce this issue in a sample application then I would suggest you to try to use Embedded Images into the report and embedded the header image into the report file. Please refer to the attached screenshot.

    Regards,

    Akshay

    ImageTest.zip

  • Posted 14 March 2023, 4:10 am EST - Updated 14 March 2023, 4:12 am EST

    [EDIT] Doesn’t like my attachments, let me try this again…

  • Posted 14 March 2023, 4:43 am EST

    Apologies, I’m not very good at this stuff. I stripped the project down as much as I could but couldn’t get it below 5MiB when zipping it. Here is a link to the zip:

    https://drive.google.com/file/d/1vvKWamGt45k_mqFfvkeQfLr-1ZySHrS5/view?usp=sharing

    I’m sure the issue is something silly that I missed or messed up. Hopefully you can help, thanks!

  • Posted 14 March 2023, 8:01 pm EST

    Hi Jonathan,

    Thanks for sharing the sample application. I have successfully replicated the issue at my end and am currently trying to determine the root cause. I will provide you with an update as soon as I have any relevant information to share.

  • Posted 15 March 2023, 10:07 pm EST

    Hi Jonathan,

    It seems that the issue was fixed after adding the following lines of code in the web.config file:

     <system.webServer>
      <handlers>
        <add verb="*" path="/api/reporting/*" type="System.Web.Handlers.ScriptModule" name="nostaticfile" preCondition="integratedMode,runtimeVersionv4.0" />
      </handlers>
      </system.webServer>
    

    For reference, please refer to the attached sample application.

    Regards,

    Akshaywebviewerhanddler.zip

  • Posted 16 March 2023, 3:06 am EST - Updated 16 March 2023, 3:06 am EST

    Perfect, thanks so much!

Need extra support?

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

Learn More

Forum Channels