Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving picture and using Crystal Reports
Message
 
À
10/08/2002 09:21:37
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00688256
Message ID:
00688294
Vues:
31
Walter,

I would be very interested in seeing the code for this, as I tried to duplicate the examples in the Crystal docs using EVENTHANDLER() and I couldn't get it to work. I did a workaround using an OLE object int he report which pulls the image from a specific location, when I generate FOX2X tables for the report I also copy the desired image to the predefined location using the predeined file name. It actually works, because I only ever have one image per report, but it's not the 'right' way to do it and I can only imagine that somewhere down the line I will have trouble.

Thanks,
Randy

>Hi Hooman,
>
>Forget general fields. Crystal Reports is not able to read general fields from a VFP table. The only way to get pictures in a crystal Report is by the following conditions:
>
>1. Use Crystal Report 8 or higher.
>2. Use VFP 7 because of the EVENTHANDLER() function (it may also be possible in VFP 6 and the VFPCOM.dll).
>3. Use the RDC automation controler in combination with the CrViewer ActiveX control.
>4. Make use of a field which contains the location of the picture in stead of embedding it into a MEMO field.
>
>At this moment I do not have the coding details at hand, but the following has to be done:
>
>1. Open the report with the RDC automation controler
>2. write a eventclass which contains the events of a section (See developer.hlp of your crystal documentation) and instantiate an eventobject of it.
>3. Bind the section (Sections are numbered from top to bottomm (for example Reports header = 1, Page Header1 = 2, PageHeader2 = 3, Group Header = 4 Details = 5, groop footer = 6, etc) containing the picture to your EnventObject.
>4. In the format event you can adress the formattedpicture property of the picture object on the form and change it into the new picture. (From the top of my head: so don't shoot me if I'm wrong: oReport.Section(3).reportobject("Picture2").FormattedPicture = c:\MyPictures\MyImage.bmp, or if related to the value in another field: oReport.Section(3).reportobject("Picture2").FormattedPicture = oReport.Secion(3).reportobject("text1").Value
>
>There is lots more to it. I've written a class for it and it works great. I can't give you the details of this class as I dont' have them at hand at the moment. If you're really interested just answer this and I'll see what I can do.
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform