none
Problem displaying external Images in Report Viewer Control ? RRS feed

  • Question

  •  

    Hello,

     

    I have image location stored in the database

     

    C:\\Users\\Public\\Pictures\\Sample Pictures\\Desert Landscape.jpg

     

    but the report viewer control doesn't display it. In the code enableExternalImage = true is already done.

    Even the Mime type is set.

     

    Can someone please tell what is wrong ?

     

    This is a Windows Application ...

    Monday, July 2, 2007 8:07 PM

Answers

  • I already told you: you concatenate what is stored in the database with the prefix

     

    file://C:\\Users\\Public\\Pictures\\Sample Pictures\\Desert Landscape.jpg

     

    should work (I just checked with spaces in the folder and filename, just in case)

     

    but I generally use

     

    file://C:/Users/Public/Pictures/Sample Pictures/Desert Landscape.jpg

     

    ... forward slashes, no doubling.

     

    >L<

    Thursday, July 5, 2007 2:34 PM

All replies

  • Anyone with a suggestion or an answer why the images don't display...
    Wednesday, July 4, 2007 3:02 PM
  • You need to use a file:// reference. (you can build one as an expression concatenating the "file://" prefix with the location as stored in your database, I mean)

     

    >L<

    Thursday, July 5, 2007 4:48 AM
  • OKK, this is what is stored in the database

     

    C:\\Users\\Public\\Pictures\\Sample Pictures\\Desert Landscape.jpg

     

    So , I should remove C:\\ and instead of that should be

     

    file://Users\\Public\\Pictures\\Sample Pictures\\Desert Landscape.jpg

     

    or should be file://C:\\Users\\Public\\Pictures\\Sample Pictures\\Desert Landscape.jpg

     

    Thanks for the info.

     

    Harsimrat

    Thursday, July 5, 2007 6:16 AM
  • I already told you: you concatenate what is stored in the database with the prefix

     

    file://C:\\Users\\Public\\Pictures\\Sample Pictures\\Desert Landscape.jpg

     

    should work (I just checked with spaces in the folder and filename, just in case)

     

    but I generally use

     

    file://C:/Users/Public/Pictures/Sample Pictures/Desert Landscape.jpg

     

    ... forward slashes, no doubling.

     

    >L<

    Thursday, July 5, 2007 2:34 PM
  • ="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()

     

    Monday, May 24, 2010 8:42 PM