3 Replies - 7698 Views - Last Post: 25 October 2007 - 05:54 PM Rate Topic: -----

#1 coldiron  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 28-March 07

CF Report Builder Iif syntax for images

Posted 11 October 2007 - 03:59 AM

I am using CF 8 with CF Report Builder 7.

I have a working CF Report that displays images dynamically, but throws an error if the field in the database is null (Report data binding error Image not found).

I am trying to write an Iif statement, but cant seem to get it right.

This code works if the field has data

application.sImageLocation & "/" & query.listingimage1


My goal is to display the image represented in the field, but if the field is null or empty, I want to display an image in the same directory called "placeholder.gif"

This is the Iif statement I have been working with. Can you help me with what I am missing?

application.sImageLocation & "/" & Iif([query.listingimage1] IS "Null", "/fsboplaceholder.gif", query.listingimage1)


Is This A Good Question/Topic? 0
  • +

Replies To: CF Report Builder Iif syntax for images

#2 dswens  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 16-October 07

Re: CF Report Builder Iif syntax for images

Posted 23 October 2007 - 06:08 PM

If it pleases the court, you could simply make the default value for your database field "placeholder.gif" and then use an update query to replace it with other images as necessary.
Was This Post Helpful? 0
  • +
  • -

#3 coldiron  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 28-March 07

Re: CF Report Builder Iif syntax for images

Posted 25 October 2007 - 09:26 AM

View Postdswens, on 23 Oct, 2007 - 06:08 PM, said:

If it pleases the court, you could simply make the default value for your database field "placeholder.gif" and then use an update query to replace it with other images as necessary.


Thanks for the input.

I tried that. My problem is that the data entry field is part of a "Cfupload", so you cannot have any default values in this coldfusion control on the web ap. Even if it is a default value in the database. It is part of the security measures in CF.

I have been able to work around it in my .cfm files by using a "cfif". What I am looking for is how to write the same "if" statement in Coldfuion Report Builder
Was This Post Helpful? 0
  • +
  • -

#4 dswens  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 16-October 07

Re: CF Report Builder Iif syntax for images

Posted 25 October 2007 - 05:54 PM

Sorry I couldn't be of more help. I haven't used the Report Builder yet so that's beyond my scope.
Hope you find the solution soon... I know how it is to be stuck on some little detail like that. Good Luck!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1