Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why is UDF in detail band called multiple times?
Message
From
27/09/2001 15:30:04
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00561609
Message ID:
00561628
Views:
20
>In the book "1001 Things You Wanted to Know About Visual FoxPro" they talk about adding the greenbar effect to your reports. It adds a nice touch to the reports, but I am having trouble implementing it consistantly across the bands of the report.
>
>I created a simple report with just one field. In the Print When of this field control, I added fGreenBar(). In the fGreenBar function I added a Wait Window. Now if I run this report for just one record, the function gets called five times? Why?

VFP internally calls it for who knows which reason, just to make sure everything prints right. I observed that behavior ten years ago, and the solution was to keep a report variable which will store the recno(), and the function would check if this has changed, in which case it stores the current recno() to the variable and does what it was written for, else it just exits. This variable should be zero initially.

Maybe a better solution would be to have this function as OnEntry of the detail band; haven't played with it but it may be called only once per band.

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