Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why is UDF in detail band called multiple times?
Message
From
28/09/2001 10:24:22
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00561609
Message ID:
00561912
Views:
26
This message has been marked as the solution to the initial question of the thread.
>>Not knowing what's a greenbar (I imagine it as a salad bar :) I can only suggest a separate function and a separate variable for each band, or the same function with different parameters, so it would check for the recno() in the detail, and the group expression in group bands.
>
>Dragan,
>
>I tried the same function with different parameters for each band, but I had inconsitant results. That is why I started tracking where the calls were coming from with a Wait Window in my function.
>
>FYI, the greenbar effect is kind of a throwback to the old computer paper which had alternating green and white bars. It can be very helpful when you are looking at many rows on a printed report. You can simulate this effect with a shaded rectangle on the report.

Ah, the old pyjama paper. Well, the principle still holds - have a variable for each band to hold the band expression - a copy of recno() for detail, copy of group expression for each group band, and eof() for the grand total, and compare each time. If it's changed, it's the first call for that band; store the new value to the variable, and do whatever you want.

While the PrintWhen expressions may be evaluated many times (seems to be it recalculates to make sure the line would be blank, if you have "eliminate blank lines" set on), I think the OnEntry expressions would be calculated only once. You could have a separate set of logical variables in the report, set them from OnEntry functions, and have these variables as PrintWhen expressions. Thus you'd calculate only once, and you won't care how many times Fox looks at these variables.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform