Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Writing and Calling functions from Crystal Reports
Message
De
17/05/1999 14:23:31
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00218452
Message ID:
00219709
Vues:
26
>>We have several functions in Visual FoxPro which are used to perform processing on a character string. the functions accept the string as a parameter, and return another string. This return string is then used in a formula which appears on the report.
>>
>>We are attempting to duplicate this report in Crystal Reports, running as a stand-alone report connected to the FoxPro database via ODBC. However, to the best of our knowledge, there is no way that Crystal Reports can call a FoxPro function. Somehow, the functions are going to have to be recreated as a .DLL or an ActiveX object which Crystal Reports can reference. I have no experience in writing FoxPro .DLLs, and would be reluctant to try. Besides, I don't think this would be acceptable to Crystal Reports.
>>
>>According to the Crystal Reports help, DLLs, a.k.a. UFLs, must be written in C. We have C++ as part of Visual Studio, but even if this is an acceptable version of C, we have no practical experience in it, so writing the DLL in C++ is not an option.
>>
>>Could the DLL / UFL be written in Visual Basic? I know that Crystal Reports comes with Visual Basic, so I would (pardon the word) ASSUME that DLLs created in Visual Basic would work with Crystal Reports, with a minimal amount of fuss.
>>
>>I have already posed this question to Seagate Crystal Reports Tech Support, but I don't know how Fox-savvy they are. I'm hoping that someone with a more Fox-oriented mindset might be able to help. As I stated, the ideal solution would be to call the FoxPro function from Crystal Reports, but I don't see that happening. The most preferred solution would be to rewrite the functions in VB and compile them as a DLL. Anything beyond that, and we are getting into a very difficult and time-consuming solution for us. We are fairly new to Crystal Reports, and have never tried to write a Crystal Reports function, so some of the steps which would be obvious to a Crystal Reports guru are not so obvious to us.
>>
>>TIA,
>>
>>Bill
>
>Bill,
>
>Since you can't get Crystal Report to execute a function for you, why not do all the work on the VFP side and give Crystal Report a finished master cursor with all the results in it?
>
>José


We are not calling Crystal Reports from within FoxPro; just the opposite. The Crystal Reports forms we are creating will access the FoxPro database via ODBC. Using a view is not really an option, because the functions which need to be performed on the data are user-defined functions (actually, a function library which we purchased). I can't really put them in as stored procedures, since the Crystal Reports application is to have as minimal an impact on the existing FoxPro code base as possible.

As it turns out, we were able to work out a solution. The vendor who wrote the function also has the function available as a .DLL. We were able to write a Visula Basic "wrapper" around the DLL, coding it as necessary for the Crystal Reports UFL. The actual VB code was minimal; two DECLARES to the .DLL, and two functions to call the DLL functions. Something to keep in mind should anyone need to write UFLs for Crystal Reports.

Thanks,

Bill
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform