Not displaying RDLC External Image while using HTTPS

Answered Not displaying RDLC External Image while using HTTPS

  • jeudi 5 avril 2012 03:35
     
     

    I have created an RDLC report which consist of a header logo image, I'm using "External Image" property of the report to change the logo dynamically at runtime, This works great with the "http" environment, But when I deployed my application in secured environment (https) I have noticed that Images are not loading in the RDLC report.

    Images were loading properly when I was "Embedded" them in the report in both http and https environment.

    And

    "Yes" I'm able to access the image directly using https://******/Images/logo.bmp

    "Yes" I have a valid SSL certificate.

    I have tried by changing the image path at runtime using below snippet :

    string logoImagePath = Request.Url.AbsoluteUri.Replace(Request.Url.Query, "");

                if (logotype == "1")
                {
                    logoImagePath = logoImagePath.Replace(Request.Url.AbsolutePath, "" +      @"/images/singlaslogobukom.bmp");
                }

                 if (Request.IsSecureConnection)
                {
                    logoImagePath = logoImagePath.Replace("http", "https");
                }
                rparas.Add(new ReportParameter("Path", logoImagePath));

    But No Luck!!

    Kindly help in resolving this issue, Thanks in advance.

    - Nikhil.

Toutes les réponses

  • mardi 10 avril 2012 09:42
     
     

    Well, As per my understanding PDF is not able to access the images in secured connection mode, So I'm changing my Image path to "http" like this :

                 if (Request.IsSecureConnection)
                {
                    logoImagePath = "http://" + Request.Url.Authority + ":" + "8080" + "" + actualPath;                
                }

    Now its working fine.

    Thanks,

    Nikhil.


    Nikhil

    • Proposé comme réponse Manjur Alam jeudi 19 avril 2012 07:04
    • Non proposé comme réponse Manjur Alam jeudi 19 avril 2012 07:04
    •  
  • jeudi 19 avril 2012 07:05
     
     Traitée
    I was also getting same issue however it has been resolved by using valid ssl certificate. So don't need to use http instead of https. Thanks to my colleague Rajkishore Upadhyay.