Yes, you are right, I meant UFL. I am currently working with Crystal 8.5. The report that I am currently working on has a sub report which supplies Temperature, Pressure and Relative Humidity. In order to calculate the KH I have to pass the values of these three fields into a function which will perform the calculation and return the value for KH. I need to display the KH value on the sub-report. The report looks like:
Test Results:
Dist Temp Pressure Rel Humid KH DF SCF
Bag 1 -5.97 100.89 80.53 .78 22.03 6487
3.00
Bag 2 -6.62 100.87 76.18 .78 38.05 11071
3.80
Bag 3 -6.01 100.85 76.09 .78 28.25 6475
2.94
I have created this sub-reoprt up the point of all the fields except the calculated ones, which are the KH and DF.
The Temp, Pressure, Rel Humidity will have to be assigned to a variable which get passed to a function called...let's say, 'Function getkhvalue(pressure AS Single, temp AS single, relHumid AS single)' The body of the calculation(written in VB for now):
**********************************************************
Dim ra, pb, pd, h, kh AS single
ra = relhumid
pb = pressure * 7.501
pd = steam(temp)
h = (43.478 * ra * pd)/ pb - (pd * (ra/100.00)))
kh = 1.00/(1.00 - 0.0047 * (h - 75.00))
getkhvalue = kh
**********************************************************
The Function steam looks like (in VB as well):
Function steam(inval As single) As Single
steam = (0.0000045992 * inval ^ 4 + 0.00009034 * inval ^ 3 +
0.012783 * inval ^ 2 + 0.31761 * inval + 4.6085)
**********************************************************
It was my understanding that you could extend the functionality of crystal by including a UFL which IS a DDL. If there is a way to do the above without having to go through the effort of creating a DDL, then I would be quite pleased to discover this. This calculation is actually the easiest on this report and the next sub-report will require some heavy looping and conditional statements, etc....At any rate if you have some ideas on how I can achieve this, I would be very interested. Thanks in advance.
SE