×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • 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!
  • Students Click Here

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

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Image Control 'caching' in report
2

Image Control 'caching' in report

Image Control 'caching' in report

(OP)
I have a one page report, there is an image on it, linked to a file (third option - expression or variable name) which changes (mostly) each time the report is run.
It's a signature, depending on who signed the report, the contents of the file changes or the file may not be there (not signed yet).

After running once, the report seems to cache the contents of the file and not reread it so, until I exit the app and go back in the signature does not change - even
though I can see the contents of the fie do.

I have cooked up a work around, using a unique file name every time I run the report, but surely that shouldn't be necessary... am I missing something?

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Image Control 'caching' in report

2
Griff,

If you execute CEAR RESOURCES [Filename] before running the report, that should fix it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Image Control 'caching' in report

(OP)
Thanks Mike.

I will take a look at that

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Image Control 'caching' in report

(OP)
That's the tool - I'm grateful, I thought I was going bonkers.

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Image Control 'caching' in report

Nice, this is one I'm going to file away for future use as well!
Thanks Mike.

Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."hammer

RE: Image Control 'caching' in report

Glad it worked. I found out about this because I was once experimenting with different icons for my forms, and I found that an old version of an icon might show up even after I had edited it. So I got in the habit of doing the CLEAR command in the development environment just before running the form. That solved the problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Image Control 'caching' in report

I just tested and used both a variable name and literal file name for a report image control source, set to control source type of "variable or expression" and without cache effect that prints the current image in that file, I see the changed image, when the file content changes, i.e. when I rename another image to the constant report image file name.

So I can't reproduce that behavior, but good to know a CLEAR RESOURCE filename works in that case and should be done as a precaution.

For the reason of encapsulation I'd then go for a control source type variable and expression, as you have, set the control source to the variable name (e.g. lcImg) and create the variable as report variable holding the file name (as Value to store, Initial value empty string) and in the "on entry" property of the band printing the image put:

CODE

EXECSCRIPT('CLEAR RESOURCES (lcImg)') 
That encapsulation of creating/setting the report variable, clearing the file resource and using that variable as control source within the report makes it callable without prerequisites (other than preparing the report driving data, perhaps).

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

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