Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with _pageno
Message
From
07/11/2001 11:50:12
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00578137
Message ID:
00578554
Views:
20
>Hi Dragan,
>
>I have changed the "on exit" of the location group footer to call a proc in a prg that is available. In the proc I have one line of code. _pageno = 0. When I run it I get an error "Expression evaluated to an illegal value".

It should have been _pageno=1, but now I've done some testing, and the results are very confusing. First, this may be painfully slow - the function gets called over and over from the first record, so just for the move from 6th to the 7th group, it gets called 7 times. Now this may not be too much if you're not printing thousands of records, and the function isn't much either. Second, setting _pageno in such a function wouldn't work then, because it's called over and over. The workable solution would be this:

- create two variables:
nLastPage, calculate nothing, initial value 1
nGValue, calculate nothing, initial value a blank of the same type as your group expression.
- in group's On Entry expression store the function call, in my case it was ResetP()

resetp.prg:
nGroupVal=Int(pk/20)
If nGValue#nGroupVal
	nGValue=nGroupVal
	nLastPage=_Pageno
Endif
Instead of _pageno, print _pageno-nLastPage+1. BUT - it prints fine in group header only. Anywhere else, in page header, page footer, group footer - it behaves as if nLastPage=1. Confuses the hell out of me, and IMO, the internals of Fox reporting engine are more confusing than Hayes modem sequences :).

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