locked
Dynamic images on PDF via Reporting Services? RRS feed

  • Question

  • I have images stored on my server and I wish to take a particular image, based upon the data retrieved from my SQL Server 2005 database, and have it display on a PDF report that is being created by Reporting Services. I've seen recommendations that suggest this is how the overall process should be done - i.e. do NOT store the images in the database.  However, I cannot get the "Pointer" field from my report dataset to populate any image on the report.  I've tried full URL, partial URL, full file directory string, partial file directory string, with quotes, without quotes, but nothing seems to work.
    Can anyone give a comprehensive answer to this please? Including wjhether or not I require quotes (single or double [or none])?
    TIA.
    Thursday, February 5, 2009 1:54 AM

Answers

  •  

    Hi,

     

    From your previous post, I understand your images that are stored in the file system are not properly populated in your report.

     

    There are two possible reasons for the issue:

    1.       If you want to use a directory string, and the images is stored in the file folder which is not in the root folder of the Website populate SQL Server Reporting Service, there will be a permissions error. If using IIS6.0 as the web server, the account “Network Service” (“ASPNET” for IIS5.0) must have the permission “Read” in the folder at least.

    2.       If you want to use an URL, and the images are stored in a website which is not the same as the populate SQL Server Reporting Service Website, there will be an execution account error.

     

    To solve the issue, we could use any one of two the solutions below:

             Use the folder of images “images” as a sample. 

    Solution1: Using Directory string.

    1.       Please store the images in any folder on the SQL Server Reporting Server.

    2.       Set the account “Network Service”(or “ASPNET”) “Read” permission.

    3.       Store the Directory string in the “Pointer” field in the table. The Directory string must be full, and with prefix file://.  Do not use quotes.
    For example: file://D:/images/ XXX.jpg (“.png”, “.gif”, and so on).

    4.       Design the report, and set the property “Value” of image control as “=Fields! Pointer.Value”.

    Solution2: Using URL

    1.       Please store the images in the file system in one of the websites on the server.

    2.       Open Reporting Service Configuration manager, navigate to “Execution Account”.

    3.       Specify an account.

    4.       Store the URL in the “Pointer” field in table, and the URL must be full. Do not use quotes.
    for example: http ://< website >/images/XXX.jpg (“.png”, “.gif”, and so on).

    5.       Design the report, and set the property “Value” of image control as “=Fields! Pointer.Value”.

     

     

    Please try my suggestions, if you have any more questions, please feel free to let me know.

     

    Thanks,

    Jin


    Jin Chen - MSFT
    Friday, February 6, 2009 9:51 AM

All replies

  •  

    Hi,

     

    From your previous post, I understand your images that are stored in the file system are not properly populated in your report.

     

    There are two possible reasons for the issue:

    1.       If you want to use a directory string, and the images is stored in the file folder which is not in the root folder of the Website populate SQL Server Reporting Service, there will be a permissions error. If using IIS6.0 as the web server, the account “Network Service” (“ASPNET” for IIS5.0) must have the permission “Read” in the folder at least.

    2.       If you want to use an URL, and the images are stored in a website which is not the same as the populate SQL Server Reporting Service Website, there will be an execution account error.

     

    To solve the issue, we could use any one of two the solutions below:

             Use the folder of images “images” as a sample. 

    Solution1: Using Directory string.

    1.       Please store the images in any folder on the SQL Server Reporting Server.

    2.       Set the account “Network Service”(or “ASPNET”) “Read” permission.

    3.       Store the Directory string in the “Pointer” field in the table. The Directory string must be full, and with prefix file://.  Do not use quotes.
    For example: file://D:/images/ XXX.jpg (“.png”, “.gif”, and so on).

    4.       Design the report, and set the property “Value” of image control as “=Fields! Pointer.Value”.

    Solution2: Using URL

    1.       Please store the images in the file system in one of the websites on the server.

    2.       Open Reporting Service Configuration manager, navigate to “Execution Account”.

    3.       Specify an account.

    4.       Store the URL in the “Pointer” field in table, and the URL must be full. Do not use quotes.
    for example: http ://< website >/images/XXX.jpg (“.png”, “.gif”, and so on).

    5.       Design the report, and set the property “Value” of image control as “=Fields! Pointer.Value”.

     

     

    Please try my suggestions, if you have any more questions, please feel free to let me know.

     

    Thanks,

    Jin


    Jin Chen - MSFT
    Friday, February 6, 2009 9:51 AM
  • Thank you Jin.

    I had already managed to get your second solution to work - so, yeehaaaar!! :o)
    I felt, though, that the first solution would be more secure, but I cannot get it to work.
    Should there definitely be 3 slashes after "file:"? i.e. file:///
    Anyways, whether I have two or three slashes, it does not work.
    I do not know if "Network Service" or "ASPNET" account "Read" permission is set, but I would imagine it would be if located on SQL Server Reporting Server?
    Saturday, February 7, 2009 4:23 AM
  •  Hi,

    I am sorry for the carelessness. There should definitely be 2 slashes after "file:". i.e. file://

    And the Permission "Read" is not been set for "Network Service" or "ASPNET" automation, though the folder located on SQL Server Reporting Server.

    We can check the permisson (or set the permission) by the following detail steps:
        1.Right-click the images folder, select "Properties".
        2.In "XXX Properties" windows, switch to "Security" tab.
        3.Check if "Network Service"(IIS6.0 on Windows Server 2003) or "ASPNET" (IIS5.0 on Windows XP) is in the "Group or user names:".  
        4.If so, please make sure that the "Read" permission is allow in "Permissions for <account>" list.<account> may be "Network service" or "ASPNET".
        5.If not, it means that the account have no permissions to the folder. Please set permissions by the followsing steps:
        6.Click "Add" button, and then add the account in "Select Users,Computers or Groups" window. Back to "Security" tab after click "OK" button.Please make sure that the "Read" permission is allow in "Permissions for <account>" list.<account> may be "Network service" or "ASPNET".

    Please try my suggestions, if you have any more questions, please feel free to let me know.

    Thanks!
    Jin
    Jin Chen - MSFT
    Monday, February 9, 2009 1:30 AM
  • Hi Jin,

    I tried implementing 2nd solutions but I am not able to see the image. Not in preview or not on browser.

    Here are the details what I am trying to do:

    1) We have webapplication which is purely related to image and metadata and stuff. we store the image on hard disk in well structred directories.
    say my server url is http://<servername>:<port>/ I am able to get my image using http://<servername>:<port>/image/imageid

    2) In my report.. I have columns like imageid and image (here I want to display actual image). So in image column I have added image control set the properties to external and value I am setting something like this : = "http://<servername>:<port>/image/" & Fields!imageid.value

    3) I have not set any kind of execution account in SSRS 2008, will it necessary? since our webapplication is not at all depend upon windows authentication is all about our own security architecutre.

    Please let me know, if I can give more details.

    Thanks,
    Jaydeep
    I love walking in the rain b'coz no one see me crying
    Monday, January 25, 2010 11:03 AM