locked
Using Images - Best practise RRS feed

  • Question

  • Hello there! Nebie to SSRS so please be gentle.

    Ok, here is my query - I am creating a report that has a list of clients and a load stats come off for these...fine, sorted, not an issue. I have two parameters set up, one for the year and the other for the client ID

    I have a range of logo's for each client (60 in all) that when the client is selected, the logo appears.

    I can import all the images under the image folder and then in the properties under 'Use this image' create an Iif statement that looks up these logo's i.e.

    =IIf(Parameters!ClientID.Value=

    "MS","MSLogo",""). So essentially I can created a massive nested Iif so all my images are accounted for. However, I can't help but thinking there must be another, simpler way to do this!

    Any ideas anyone? Would it be the case of creating a table using these images and then the parameter picks the appropriate logo accordingly?

    What is the best practise for achieving the desired effect?

    Monday, October 19, 2009 11:40 AM

Answers

  • I like Raju's idea too. The only thing is, I don't know what is the link or expression to call external image. Could it be just the path to the image, including the image file name? So, for the image source, instead of embedded, use external or database. From this on, I'll let others that already experience with this explain how to do it. good luck.

    Edit:
    This is what I found out from Help

    External Images

    You can include stored images in a report by specifying a URL to the image. When you use an external image in a report, the image source is set to External and the value for the image is the URL address to the image. For a report published to a report server configured for native mode, use a full or relative path. For example, http://<servername>/images/image1.jpg. For a report published to a report server configured in SharePoint integrated mode, use a fully qualified URL. For example, http://<SharePointservername>/<site>/Documents/images/image1.jpg.

    When the report is previewed in Report Designer, preview uses the credentials of the user to display the image. When the report is run on the report server, the report server uses the unattended execution account to retrieve the image. If the unattended execution account is not specified, the image is retrieved using no credentials (anonymous user account). If either of these accounts have insufficient rights to access the image, the image will not be displayed in the report. For more information about the unattended execution account, see Configuring the Unattended Execution Account.


    Chicagoan ...
    • Marked as answer by Jerry Nee Thursday, October 22, 2009 1:43 AM
    Wednesday, October 21, 2009 5:24 AM
    Answerer
  • Hi Rich,

    A suggestion would be to have a parameter that lists all the image with it's value (id) and labels, then use this parameter to call your image.

    An example of parameter value are:

    Value       Label
    MS           MSLogo
    MS1         MSLogo1
    MS2         MSLogo2

    Then, in your image properties, for Source, use Embedded, then in Value, use =Parameters!Image.Label

    Make sure the label name in your parameter match exactly with the name in your image list.

    hth.
    Chicagoan ...
    • Marked as answer by MrRichDean Tuesday, October 20, 2009 8:17 AM
    • Unmarked as answer by MrRichDean Tuesday, October 20, 2009 9:03 AM
    • Marked as answer by Jerry Nee Thursday, October 22, 2009 1:43 AM
    Monday, October 19, 2009 4:09 PM
    Answerer
  • Hi,

    In terms of best practices using images inside a rdl, I would rather suggest deploy the images on to the report server with a separate folder as Images(optional) and then refer those images inside your RDL.

    If you embed your images into the RDL, then there might be performace issues with reports as when an user access the report, the report has to load the image on to the webser and then process it. Also the size of the RDL will be much higher when images embeded into the RDL.

    Regards,
    Raju

    • Marked as answer by Jerry Nee Thursday, October 22, 2009 1:43 AM
    Tuesday, October 20, 2009 9:27 AM
  • Hi MrRichDean,

     

    That should be based on the size of the image file.

     

    If the image is with small size such as less than 10K, and we have fewer images in a simple report, we can embed the image in the report.

    If the image is large such as 100K, we can do the way Raju has suggested.

    If the image is larger, please do not store the image in database. Retrieving larger image from database will reduce the performance of database engine. In this case, please store the file in a web shared folder or a network shared folder.

     

    For more information, please see:

    Dynamic images on PDF via Reporting Services: http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/e2018ee4-e5e4-403f-bc29-ebce29b8e73d

     

    Please feel free to ask, if you have any more questions.

     

    Thanks,

    Jin Chen


    Jin Chen - MSFT
    • Marked as answer by Jerry Nee Thursday, October 22, 2009 1:43 AM
    Wednesday, October 21, 2009 5:47 AM

All replies

  • Hi Rich,

    A suggestion would be to have a parameter that lists all the image with it's value (id) and labels, then use this parameter to call your image.

    An example of parameter value are:

    Value       Label
    MS           MSLogo
    MS1         MSLogo1
    MS2         MSLogo2

    Then, in your image properties, for Source, use Embedded, then in Value, use =Parameters!Image.Label

    Make sure the label name in your parameter match exactly with the name in your image list.

    hth.
    Chicagoan ...
    • Marked as answer by MrRichDean Tuesday, October 20, 2009 8:17 AM
    • Unmarked as answer by MrRichDean Tuesday, October 20, 2009 9:03 AM
    • Marked as answer by Jerry Nee Thursday, October 22, 2009 1:43 AM
    Monday, October 19, 2009 4:09 PM
    Answerer
  • That's a great shout! That saves me write a long and convoluted Iif statement!!! I am also toying with the idea of using a dynamic, data bound image table using URL links. Being a newbie to this, I think I’ll play with both options to get me eye in.

     

    Thanks for your suggestion, greatly appreciated.

     

    Tuesday, October 20, 2009 8:17 AM
  • Nope - turns out I am as thick as pigsh*t.

    Right, I already have one parameter set up, @Client which when selected, pulls through the appropriate datasets. How can I ensure that when this @Client is selected, the Image parameter, as described above, pulls the appropriate logo through? So essentially, when @Client is specfifed, the value selected calls the appropriate image.

    I'm really sorry for what is a ridiculously easy question - I really should start getting my head down nad actually learning this.

    Tuesday, October 20, 2009 9:08 AM
  • Hi,

    In terms of best practices using images inside a rdl, I would rather suggest deploy the images on to the report server with a separate folder as Images(optional) and then refer those images inside your RDL.

    If you embed your images into the RDL, then there might be performace issues with reports as when an user access the report, the report has to load the image on to the webser and then process it. Also the size of the RDL will be much higher when images embeded into the RDL.

    Regards,
    Raju

    • Marked as answer by Jerry Nee Thursday, October 22, 2009 1:43 AM
    Tuesday, October 20, 2009 9:27 AM
  • Thanks Raju - duly noted.
    Tuesday, October 20, 2009 9:50 AM
  • I like Raju's idea too. The only thing is, I don't know what is the link or expression to call external image. Could it be just the path to the image, including the image file name? So, for the image source, instead of embedded, use external or database. From this on, I'll let others that already experience with this explain how to do it. good luck.

    Edit:
    This is what I found out from Help

    External Images

    You can include stored images in a report by specifying a URL to the image. When you use an external image in a report, the image source is set to External and the value for the image is the URL address to the image. For a report published to a report server configured for native mode, use a full or relative path. For example, http://<servername>/images/image1.jpg. For a report published to a report server configured in SharePoint integrated mode, use a fully qualified URL. For example, http://<SharePointservername>/<site>/Documents/images/image1.jpg.

    When the report is previewed in Report Designer, preview uses the credentials of the user to display the image. When the report is run on the report server, the report server uses the unattended execution account to retrieve the image. If the unattended execution account is not specified, the image is retrieved using no credentials (anonymous user account). If either of these accounts have insufficient rights to access the image, the image will not be displayed in the report. For more information about the unattended execution account, see Configuring the Unattended Execution Account.


    Chicagoan ...
    • Marked as answer by Jerry Nee Thursday, October 22, 2009 1:43 AM
    Wednesday, October 21, 2009 5:24 AM
    Answerer
  • Hi MrRichDean,

     

    That should be based on the size of the image file.

     

    If the image is with small size such as less than 10K, and we have fewer images in a simple report, we can embed the image in the report.

    If the image is large such as 100K, we can do the way Raju has suggested.

    If the image is larger, please do not store the image in database. Retrieving larger image from database will reduce the performance of database engine. In this case, please store the file in a web shared folder or a network shared folder.

     

    For more information, please see:

    Dynamic images on PDF via Reporting Services: http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/e2018ee4-e5e4-403f-bc29-ebce29b8e73d

     

    Please feel free to ask, if you have any more questions.

     

    Thanks,

    Jin Chen


    Jin Chen - MSFT
    • Marked as answer by Jerry Nee Thursday, October 22, 2009 1:43 AM
    Wednesday, October 21, 2009 5:47 AM
  • Hello all and thank you for your suggestions.

    Quite a coincidence Jin - I found a few threads with your suggestions ytesterday and followed a few of them. What I have ended up doing is setting up a table linking client ID and the corresponding file path for each clients image.

    Then in the properties of the image box, setting the source to external. I then used the data set I had previously set up (which takes into account the client ID parameter) and picked up the FilePath.Value...et voila!!! One happy Mr Dean.

    Thank you all for your suggestions, I shall keep them in mind when doing anything like this in the future....I shall also keep in mind the potential problems once the report is deployed i.e. rights.

    Thank all, it has been much appreciated.
    Wednesday, October 21, 2009 8:32 AM
  • Hi ,
    If you have got a answer, could you please make the reply as a answer. That will benefit other community members who met the same issue.

    thanks,
    Jerry
    Thursday, October 22, 2009 1:43 AM
  • Hi Ishan H,

    Thanks your ans helped me.

     Steps I followed:

    1- I kept required Images (trf1,trf0) to following Path: C:\Inetpub\wwwroot\images

    2- Made Image Source=External (SSRS Image Properties)

    3-  Value="http://<Server Name> or <your own system name>/images/trf1.gif" (SSRS Image Properties)

    4-If required you can write Switch or IFF condition like Value=SWITCH(Fields!TValue.Value=0,"http://HPPC73408RM/images/trf1.gif",Fields!TValue.Value=-1,"http://HPPC73408RM/images/trf0.gif", Fields!TValue.Value=1,http://HPPC73408RM/images/trf2.gif)

    5- When I ran report, Images were not displaying. Go to Start->Run->Type inetmgr & press Enter->Internet Information Services window will open->Your System->Web Sites->Default Web site->Images Folder->and tried to Browse images on right click of particular image->Click on Browse , it was showing error "You are not authorized to view this page" then->Right click on Images Folder->Properties->Directory Security-> Anonymous access and Authentication control->Edit->Type your password. It happened because I changed my System Password.

    6-Deploy the report to server, It will pick images from folder images from Path: C:\Inetpub\wwwroot\images


    Thanks Shiven:) If Answer is Helpful, Please Vote

    Tuesday, October 11, 2011 6:48 AM