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

Print a photo with Crystal 8.5 from VFox

Status
Not open for further replies.

LALLORA

Programmer
Aug 6, 2003
22
IT
Hi all.

I use Crystal Reports 8.5 and Visual Fox 6 (but I'll move to the version 9 soon). I need to print a document where, besides the code and product description, I have also to print the product's photo. For each photo I stored, in a table, the full pathname of the file. The user selects some products and he needs the list of the selected products, each with its photo.

I tried several ways. The first I tried was to modify the Crystal report's OLE object property "FORMATTEDPICTURE" but I hadn't it available with VisualFox; I managed to modify, for example, the picture dimensions but not the picture itself. I read that this operation is allowed with VB. Does someone know whether this function is also available with VFoxPro ? Or how can I do it ?

Second attempt. I tried using the APPEND GENERAL instruction. When Crystal recognises the field as a BLOB field it prints correctly the image but my images are JPEG photos and the VFoxPro table's column contains only the image icon (the link to the photo). That image is
printed (not the content of the file). I found a workaround to solve this problem renaming the JPEG file as BMP and it works ! But I do not like this solution at all !

Is there someone who can suggest any other solution ?
Thanks.
Ciao.


Marco (Italy)
marco.dicesare@elmec.it
 

Marco,

There's no really satisfactory way of printing table-based graphics in CR 8.5. As you have found, you can insert a static picture into a report, but you cannot bind the picture to a field in a table.

The only solution I have seen is that you collect together all the products' photos, manually insert these into the report, one on top of another, then create a formula which conditionally suppresses all the photos except the one that corresponds to the current record (a bit like the "print when" feature in VFP's reporting tool).

This would work well enough if you only have three or four products, but with any reasonable real-world data volumes, it will obviously be unworkable.

I'm sorry I can't suggest anything better. If anyone knows a good solution, I'd very much like to hear it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Actually, you CAN print a picture from a table in CR 8.5, but can't in 9 (due to a bug in 9.0). Check the Crystal articles on my web site.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 

Craig,

Actually, you CAN print a picture from a table in CR 8.5, but can't in 9 (due to a bug in 9.0). Check the Crystal articles on my web site.

Can't see it. Which specific article are you referring to?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Doh! You're right .. it's not on the site. I do adress it in my book.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top