July 10, 2013 at 11:20 am
I didn't see a section for SSRS 2012 so I figured I'd post this here...
I have a report that I am writing that displays information about a given client; you choose the client from a parameter, and it returns a bunch of data regarding what services we've done, money spent, etc.
One of the things I'd like it to do is display the logo of the client selected. I have a folder on my server with a .gif for almost all clients, and I've added an image to the report as an external image with the Value set as the path plus the client ID. It works like a charm.
My issue is that we are missing some logos for clients. Ideally, we'll get those - but in the meantime I was wondering if anyone here on the forum knows of a way to set a default for the image; that is, if it can't find a file display some default image instead of the blank red X thing.
Thanks in advance 🙂
July 11, 2013 at 6:46 am
How many clients do not have images?
If not a huge number, how about choosing an image as a default, and placing it in the same folder, and then duplicating and renaming it, so all clients will pull an image, including the default?
July 11, 2013 at 9:41 am
We have approximately 300 clients, and I am missing about 75 of them. It's not a bad idea what you're suggesting... I was hoping there'd be a default but I may have to do something like that.
Thanks 🙂
July 12, 2013 at 6:48 am
Do you have a list of clients who have images, that you could use to create a table in the db? If so, you could then use that table along with IS NULL to point all imageless clients to one default. Still entails a little bit of work, but may be easier than duplicating and renaming.
July 12, 2013 at 7:56 am
You simply need a function in your report code.
Something like this should do it:
Function getImage(path as string) as string
If System.IO.File.Exists(path) Then
Return path
Else
Return "E:\Images\Default.png" ' Change this to an actual path to a default image
End If
end function
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply