Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Total Value on a 2-band report
Message
From
15/12/2006 20:05:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01178103
Message ID:
01178224
Views:
10
>>
>>You didn't, perchance, sum the variable in two places? In the report variable, and in the expression field.
>>
>>If you did that, you must check "Sum" only in one of those two places.
>
>No. I can see it is very simply the fact that VFP "counts" every record, even those that don't have the field that need to be summarized. The only solution I can think of, so far, is to create a third cursor (outside of the report) and use fields of this cursor to show totals. But this is, IMO, kludgy. I would be surprised if VFPT didn't think of this. So I hope I am missing something simple and maybe someone will point me in the right direction.
>
>Thank you.

I didn't work yet with multiple detail bands, so I may be way off-track.

However, I have seen that conditionally adding a value often helps:

The expression in the report variable might be iif(SomeCondition, 1, 0) if you want to count, or iif(SomeCondition, SomeValue, 0) if you want to sum.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform