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!

HOW TO PLACE A PICTURE ON CRYSTAL REPORT 1

Status
Not open for further replies.

remsor

Programmer
Nov 5, 2002
101
PH
Anybody has an experience in inserting picture into crystal report ver 8.5 from vfp6.

In my table i have 3 fields:
Barcode
Item
Picturename - (only the path and name of the picture save here)

How do i display the picture in every records to the crystal report.

thanks..

 
insert your picture on the detail section


cheers

pgtek

 
You can't do it in VFP6 because you need to inherit the interface of Crystal's Format event. Interface inheritance is not supported in VFP6. You can do this in later versions of VFP (7.0 & 8.0).

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
I don't recommend the method suggest in FAQ767-1988 when using Visual FoxPro. There are a couple of issues with this:

1. It requires storing image in a General field. This causes the FPT file to get HUGE in a very short time.

2. You'll need to use ODBC or ADO to access the data as Crystal Reports does not recognize a General field when using a native connection.

One other note. There is a bug in Crystal Reports 9 that causes the RDC integration method to fail. IMO, the best solution when using VFP is to store the images as separate files then use Crystal Reports 8.5 for reporting. Again, this requires VFP 7.0 or 8.0.

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

If you are using the RDC and sendig the picture path to the section format event, I would think that as long as you could read the path from the field, that you could then pass it to the format event. Am I missing something?

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Yup, that's how it's done. However, you need to inherit the interface of Format event from the RDC. This can't be done in VFP6, which the original post indicated is being used as the development tool. This is because VFP6 does not support interface inheritance. It was added in VFP7.

The problem with doing this with CR9 is that Crystal Decisions broke something in the RDC. When VFP queries the RDC and asks it for the names of the interfaces, it is returned a 0, indicating there are no interfaces. VFP is very literal in it's usage of COM, following the spec very closely. Some languages, VB for example, are more liberal in their COM implementation, so the call to the RDC works there. As with most tools vendors, the RDC was tested with VB, but not with VFP.

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

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
im not sure if this will help you, but this is how i usually do it. i use crystal reports 8.0.
i put the field with the path, and make it invisible, and then i have a picture control, and on the code i do like this:

Code:
Private Sub Section3_Format(ByVal pFormattingInfo As Object)

Set Picture1.FormattedPicture = LoadPicture(Field1.Value)

End sub


Eli
 
Great code for VB, but it doesn't work the same way in VFP.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
ELIBB...
I'd love to hear more about your picture control. I've never done this before. Can you give me more instruction?
Thanks in advance!
EPratt
 
in vb i have a control for crystal reportes, its like a picture box, You just have to put it on the details section, you will have to link it to a picture at design time, but it wont matter, since You will put the code i told you before.
i hope it helps

Eli
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top