none
External Images with Relative Path? RRS feed

  • Question

  • I have a WinForm application containing several reports. The reports contain some Image fields with a source of External, as I want the images loaded from the client PC. I can get it working if I use an absolute address (e.g. file://c:\temp\report.bmp) but I can't seem to get the images loading from the application folder. Is it possible to use a relative path such as file://.\report.bmp?

     

    If not, how can I programmatically change the Image properties at runtime through the ReportViewer control so I can set an absolute path? I can't set it at design time because I don't know where the user will install the client application.

     

     

    Monday, September 17, 2007 10:41 PM

All replies

  • ="file:///" & Fields!BeforePhoto.Value
    Set the source to External
    when you do this you do not need to put in the mimet type. it's ignored anyway.
    MOST important...

    For the reportviewer..refresh the report BEFORE external is set to true. Otherwise you get the red x.
            dataset adapter fill here
            Me.ReportViewer1.RefreshReport()
            ReportViewer1.LocalReport.EnableExternalImages = True
            Me.ReportViewer1.RefreshReport()

     

    • Proposed as answer by mindserve Thursday, August 12, 2010 12:48 PM
    Monday, May 24, 2010 8:44 PM