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

Referencing External Images in Reports

Status
Not open for further replies.

ralphcarter

Programmer
Aug 8, 2006
28
0
0
US
We have a retail application created in VFP 9.0 and we are creating VFP reports for it. We need a way for the customer to EASILY add their own logo into the header of the report. In other languages this is possible with an external reference to a bitmap (ie VB load picture "companylogo.bmp").
I have read help and it seems I have 2 options. I can either imbed the picture in the report myself or I can imbed the picture into a general field in a table myself (since there seems to be no easy way for the user to do this).
I cannot believe that VFP does not have a way to reference an image file external to the report or table and bring it in programmatically. Can someone help?

Thanks

Ralph Carter
Programmer
QUESTware corp.
 
Ralph,

No, you don't have to either of those things.

Just add an OLE Bound/Picture object to the report. Double-click on it to bring up its properties window. Set "control source type" to "expression or variable name". And enter the name of a variable in the Control Source box.

When you run the report, store the path and filename of the customer's logo in the above variable. Provided the variable is in scope when the report is run, the correct image should show up. (I usually make the variable PRIVATE to ensure it's in scope.)

Give it a try.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,

Thanks. We had already tried your suggestion but unknown to us the bitmap another version of the bitmap we were trying to load was imbedded in to the project and it was always pointing to that copy so it didn't seem to work. When we removed the imbedded bitmap everything worked perfectly.

Thanks again. You were most helpful.

Ralph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top