Options

NAV webpage Viewer Add-in not working

txerifftxeriff Member Posts: 492
Hi All,

I hope some1 could help. I was trying with the webpage viewer addin:
Microsoft.Dynamics.Nav.Client.WebPageViewer

however it does not show anything, see attached. Please note error page is something I wrote as a caption for it.

I was thinking it could be some issue with firewall but it does not load a gif file to a local path.
Any ideas? I had a look to service setup, but I can´t find any setup. It´s D365 on prem. by the way.

Thx!

Answers

  • Options
    txerifftxeriff Member Posts: 492
    Any1?
  • Options
    AlexDenAlexDen Member Posts: 85
    Hi,

    Are you able to display images from web?
    Provide code how you generate html to display.
  • Options
    txerifftxeriff Member Posts: 492
    edited 2020-03-03
    AlexDen wrote: »
    Hi,

    Are you able to display images from web?
    Provide code how you generate html to display.


    Hi,
    it´s as simple as this:

    WebpageViewer - OnControlAddIn(Index : Integer;Data : Text)
    CurrPage.WebpageViewer.Navigate('C:\Users\me\Desktop\Fobs\d.gif');

    WebpageViewer::ControlAddInReady(callbackUrl : Text)

    WebpageViewer::DocumentReady()

    WebpageViewer::Callback(data : Text)

    WebpageViewer::Refresh(callbackUrl : Text)
    CurrPage.WebpageViewer.Navigate('C:\Users\me\Desktop\Fobs\d.gif');


    it doesn´t work using a website neither (https://www.google.com, I´ve tried), so that´s why I tried with a gif.
  • Options
    AlexDenAlexDen Member Posts: 85
    Try to put your code into WebpageViewer::ControlAddInReady(callbackUrl : Text) trigger instead of WebpageViewer - OnControlAddIn.
  • Options
    txerifftxeriff Member Posts: 492
    AlexDen wrote: »
    Try to put your code into WebpageViewer::ControlAddInReady(callbackUrl : Text) trigger instead of WebpageViewer - OnControlAddIn.

    Thanks for that.

    Now I get : this error if I point to gif in a local windows folder:

    Insecure URL Specified.

    Please contact your system administrator.


    go

    However, I tried to a interneth path and it works fine.

    https://media.giphy.com/media/uIGfoVAK9iU1y/giphy.gif

    thanks.
  • Options
    AlexDenAlexDen Member Posts: 85
    It is restriction of WebBrowser control - it can navigate only to https urls.
    But you can prepare HTML dynamically, for example;
    CurrPage.WebpageViewer.SetContent(
      STRSUBSTNO('<img src="%1">',ImageFileName));
    

    Use it instead of Navigate.
Sign In or Register to comment.