Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving picture and using Crystal Reports
Message
De
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:
00688291
Vues:
29
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.

Walter,









>I'm desperately looking for a solution to my problem. In fact cannot believe that VFP isn't able to saticefy my need, but now i'm really desperate.
>
>I'm developing an application to be destributed between several customers. Each of them, apparantly, has it's own logo. i want to put an interface to get the logo file name from user, and save their logo in a table. Well, no problem till now: we have APPEND GENERAL command. But the problem raised when i was going to use this general field in a report: the general field contained a small low-resolution icon from the graphic file and a blabla.bmp name below it!!!!
>So i couldn't use it as a logo on the heder of each report, and still wondering what to do.
>I'm generating my reports with Crystal Reports.
>
>
>Briefly, my problem is this:
>
>How should I save a picture in a VFP table if I want to use it in a report, generated by Crystal Reports?
>
>
>I'll really be thankful to whome helps me and released me from this headache.
>
>Thanks in advance
>Hooman
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform