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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Old image loaded into a report? 1

Status
Not open for further replies.

thatguy

Programmer
Aug 1, 2001
283
US
Hey there folks--

This is in VFP8.. I have an image on a report with its Image property set to a global object's property, so every time the report is run, it should show whatever image ("path\filename") is stored in oApp.clogo. I store the images in the exe and, when the user selects from a dropdown, I strtofile() the appropriate image out to disk with the general name "logo.gif".

So I run the app, select from a dropdown and I can see the correct image is written out to disk. I run the report and the correct logo shows up. Then I go back and select another item from the dropdown and I see that the logo.gif on disk is overwritten with the correct (new) image. BUT, when i run the report again (same report file), the first image is shown -- not the one presently on disk in the file logo.gif.

Is this a bug? Is there some report buffer I have flush first? Any help would be appreciated.

Thanks
-- frank~
 
You probably need to issue CLEAR RESOURCES in between to get rid of VFP's cached version of the image.

Tamar
 
thank you, Tamar.. that was it.. sure enough in the help file:

For example, a report might display graphic images from a database, all of which are named TEMP; however, because they all have the same name, Visual FoxPro will not reload each new graphic unless the existing one has been cleared from memory using the CLEAR RESOURCES command.

the toughest part is knowing where in the help file to look! lol

sidenote: another solution i came up with thru messing around was to name each image differently when it's written to disk. since i was using the same global object property in the report, i just changed the filename in that property before calling the report.. a bit more code, but still a viable solution.

-- frank~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top