Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Percentage calculation in expression of report
Message
From
30/11/2001 14:26:29
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00588031
Message ID:
00588190
Views:
45
Max --

As far as I can see, the form of the calculation is correct.

I'd next explore this as a data-driven problem.

Is the filter on the variable the same as the filter on the data set for the entire report?

If it is, then,

Try to find the most restrictive condition you can, hopefully down to 1 record. Then, trace the values through the process. Is the variable assigned to the value you expect? Do the other variables or table fields have the expected value?

If one of the values isn't what you expect, the (or a) problem lies there.

If they are in that case, then the query operates properly under some conditions, and not under others. Try other equally restrictive conditions to try and narrow down under what condition the problem occurs.

HTH,

Jay

>Hi Jay,
>I took the second route as I didn't know how to carry out the first one.
>The report opens but the result is still 0. When I calculate by hand what the result should be I get 78.2 as the result.
>Thanks
>Max
>> Max --
>
>> You could go a couple ways.
>
>> My natural preference would be to calculate this before running the report, if you need it calculated once as the sum of the records.
>
>> In the report, substitute nmyTempPublicCalc for calls to Calcrpt().
>
>> Then couch your call to the report with this code.
>
>> PUBLIC nmyTempPublicCalc
>> CALCULATE SUM (Calcrpt()) FOR FilterUsedOnReport TO nmyTempPublicCalc
>
>> REPORT FORM ....
>
>> RELEASE nmyTempPublicCalc
>
>> There are more sophisticated ways of defining the scope of the variable, but this should get the job done. This is probably faster than the next option.
>
>> Another way would be to define a report variable MyCalc (or whatever). Check the "Sum" line in the Calculate box. Then, in Value to Store, put in Calcrpt(). Then, use the MyCalc variable in place of the function call. This is probably simpler than the first option.
>
>> HTH!
>
>> Jay
Previous
Reply
Map
View

Click here to load this message in the networking platform