Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing report variable by reference to a function
Message
From
26/11/2008 10:15:18
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01364082
Message ID:
01364193
Views:
14
>>
>>It should, but.
>>
>>With code called from within a report, you never know how many times it is called. Specially if there's a preview going on - to show page 7, VFP evaluates and sizes up everything on pages 1 through 6, then renders page 7. Which means that any code in the expressions on these pages is also run when the expressions are evaluated - some of them twice (not sure this still holds, I observed it in several versions of VFP, but don't remember which). If you're using _pagecount variable, whole report is run just to calculate the total number of pages - and all the code on each page too (some of it maybe more than once).
>>
>>I hope you got the picture. My guess is that it will work, but you'll get a few surprises, aka "unexpected behaviors".
>
>Thank you for your input. I can see how things can get "complicated". And I actually thought, after I posted the message, that what I am trying to do using this function call from an Expression is not such a good approach (for other reasons than how VFP does it). I have to rethink everything.

Even when it works, the "calculate it within the report" approach was somehow always disappointing to me. Very soon it would get into something that just can't be done that way, or would get too complicated, or (the worst) was actually needed somewhere outside of the report, so it had to be repeated in a different form. Which eventually taught me that having intelligent report is a fine but futile art. Preparing the data to report is, IMO, best done in a piece of code - SQL plus some grinding - and the display of the results is where a reporting engine should be in charge. Then if that code needs to be reused elsewhere (a bizobject? another report? grid with totals?), it can be.

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