different images in a row of a table

  • Hi!

    Is it possible to load an image or the value of backgroundimage for a cell of the detail-area of a table in dependence of the loaded value.

    For exsample:

    value is 1 and now the Backgroundimage is "image1" from embedded Imagelist.

    value is 2 and now the Backgroundimage is "image2" from embedded Imagelist.

    Know what i mean?

    Thank you.

    Greetings

    Chris

  • Where are you doing this? I think it's reporting services, so in the value field of backgroundimage property of each cell enter an expression like this:

    =iif( cellvalue=1, image1, image2)

  • Hi!

    Thank you!

    But what is the definition of image1? Is this an embedded image with the name image1? It doesn't work.

    Greeting

    Chris

  • This sounds like a 'slowly changing dimension' to me. Wikipedia has a good explanation of scd types and how to handle them. If you think this applies to your situation, try getting a book about Kimball methodology of designing a BI solution.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • Try using an "external" image source.

    I suspect the embedded source won't work, because it may not be properly parsing the expression code.

    =Iif (Value = 1, "Http://..../Image1", "Http://....//Image2")

    This works for me.

    Note: remember, you can still include / use images in your RS project (and should). The URL's to report server are accessible to pull the image. and you should use the global functions to pull the server / folder names. Be warned that those functions don't resolve properly in Visual Studio, so if possible just do your final testing against your development RS server.

  • Hi!

    Now, my expression looks like:

    =iif(Fields!StateProvinceID.Value = 79, "http://www.insomnio.de/images/stories/docu_pers_web.jpg" ,"")

    the result gives back the "http://www.insomnio.de/images/stories/docu_pers_web.jpg" - string, but no image?

    What's my fault?

    Greetings

    Chris

  • Hi again.

    Didn't fix the Problem:

    1. Where do i have to store the image?

    2. What is the url to the image?

    3. Do i have to use the Espression with "" like "http://..." ? I think, in a expression, it would be recognized as a string. Or not?

    Thank you

    Chris

  • Hi!

    Okay, i'm an idiot. Now, i got it.

    I thought, i have to include the expression direct at the cell expression value. That was my fault.

    If i do so at the expression at the backgroundimage value of the cell, it works fine.

    Thanks.

    Greetings Chris

  • No problem. We all have those days.

    Reminder: Really recommend you include the image as part of your Report Server implementation, unless it makes perfect sense to have it hosted externally (to RS or your Web Server). Otherwise, I'd pity the poor developer who comes behind you and tries to "fix" the problem when the image moves, as they are apt to do in this world.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply