Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image Control 'caching' in report 2

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,333
FR
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 [Smile]ing

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.
 
Thanks Mike.

I will take a look at that


Regards

Griff
Keep [Smile]ing

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.
 
That's the tool - I'm grateful, I thought I was going bonkers.

Regards

Griff
Keep [Smile]ing

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.
 
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]
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top