Message
 
 
To
15/12/2006 20:45:14
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:
01178233
Views:
19
>>>
>>>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.
>>
>>I tried your suggestion but so far I could not find what to use in the SomeCondition of the expression.
>>
>>Here is what I tried:
>>
>>
>>iif( fsize("PO_AMOUNT")>0,PO_AMOUNT,0)
>>
>>
>>The problem with above is it is always True. That is, when VFP prints each line and even when it prints a line of Detail 2 which does not have field PO_AMOUNT, VFP returns fsize("PO_AMOUNT") > 0 as True.
>
>How about type() or vartype()?

You see, the two cursors (one for Detail 1 and another for Detail 2) are related (with SET RELATION command). Therefore, VFP "points" to both cursors at any time. Therefore, checking for a presense of a field in one cursor or another does not seem to work. I was thinking that if there was a function indicating that the report is printing a record from Detail 1 cursor or Detail 2 cursor, then that would be a good SomeCondition.

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View