Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

Thanks so much for having a place for us propeller heads to hang out and chat.

Geography

Where in the world do Tek-Tips members come from?
AlastairOz (TechnicalUser)
3 Aug 12 23:17
Hi,

I have a report which I am trying to insert an image.
Sometimes there is an image to be loaded or sometimes the cursor driving the report does not have an image to load

Now this works OK when there is an image, but when the there is no image it fails
In the report control I have tried variations of the below code in the control source (Set to expression/variable)

CODE

iif(empty(cReport.Image1file),"",cReport.Image1file) 

For some reason the control MUST have an image to load otherwise there is an error
I could go down the road of having a dummy jpg file, but I would rather not, unless there is another way


danfreeman (Programmer)
3 Aug 12 23:42
Go the empty.jpg route. Image controls need an image.
MikeLewis (Programmer)
4 Aug 12 4:30
I agree with Dan. Creating an empty file is the easiest solution. Make it the same background colour as the report background (probably white). Place its filename in your cReport.Image1file field when no other image is available.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy

AlastairOz (TechnicalUser)
6 Aug 12 21:43
Hi Mike,

I got around it fairly simply without creating a dummy file
in the report I entered into the "Print When" tab, "Print only when expression is true" section this code

CODE

!empty(creport2.Image2) 

That works

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close