Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Default image? Expand / Collapse
Author
Message
Posted Wednesday, July 10, 2013 11:20 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 4:12 PM
Points: 72, Visits: 402
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 :)
Post #1472257
Posted Thursday, July 11, 2013 6:46 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, July 24, 2014 1:50 PM
Points: 531, Visits: 448
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?
Post #1472551
Posted Thursday, July 11, 2013 9:41 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 4:12 PM
Points: 72, Visits: 402
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 :)
Post #1472663
Posted Friday, July 12, 2013 6:48 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, July 24, 2014 1:50 PM
Points: 531, Visits: 448
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.
Post #1472997
Posted Friday, July 12, 2013 7:56 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 3:47 PM
Points: 1,778, Visits: 5,730
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


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1473042
    « Prev Topic | Next Topic »

    Add to briefcase

    Permissions Expand / Collapse