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!

CR6 and VFP

Status
Not open for further replies.

icthus

Programmer
Jan 4, 2001
8
PT
I have a problem.
I'm trying to use a report in wich there is a formula that calls user defined functions (in a UFL).
I'm using CR ActiveX control to print the report. In VB everything works fine, but if i try to do the same thing in visual fox pro the formula doesn't work...

thanks a lot

regards

Lena
 
Yes, this is on one PC.
The UFL's are located in c:\winnt\system32.
 
This is one formula:

If {CabecDoc.Moeda} = CRWNomeMoedaBase() then
"Total ( " + CRWNomeMoedaAlt() + " )"
else
"Total ( " + CRWNomeMoedaBase() + " )";

and this is another formula:

WhilePrintingRecords;
BooleanVar UltimaPag;
NumberVar Apontador;

if UltimaPag then
If {CabecDoc.Moeda} = CRWNomeMoedaBase() Then
ToText( CRWConverteMOrigMAlt(FetchNumberVar("TotalAPagar") , {CabecDoc.Cambio} , {CabecDoc.MoedaDaUEM}) )
else
ToText( CRWConverteMOrigMBase(FetchNumberVar("TotalAPagar") , {CabecDoc.Cambio} , {CabecDoc.MoedaDaUEM}) )
else
""

The UDF are implemented in a UFL called u2lcalc.dll
 
1. Does the FoxPro environment give an error?
2. Is there a date field in this formula?

Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 

1. No, everything works fine, except that the report should print some totals and it doesn't print anything.

2. No, the formulas are concerned with currency and exchanges. They should print totals.

Lena
 
So the report runs fine but these two formulas print nothing? And the same EXACT report run's fine against the same EXACT data when run in VB?

This may not be the function. Usually, if the function were missing, then you would get an error message from the formula at runtime.

I think something else is different, also. Does this report use the "convert Null to default" setting? Null values can cause a formula to 'choke' and print nothing.

See if there are any other differences in the environments.

Nothing else comes to mind, except I do find it odd that in the first example the functions are used with parens in the formula, and no arguments are given in the parens. Not sure where it is getting the data.

If you are convinced that it is the UFL try posting again with the heading 'can VFP use UFL's?' And see if anyone else has had problems.

Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top