Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
'Continued' in the header
Message
De
30/12/2014 10:26:30
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
30/12/2014 10:16:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01612786
Message ID:
01612846
Vues:
64
>>>>>>Using "Page XX of YY" is more informative than "Continued" and easier to implement.
>>>>>
>>>>>That's great, but the user (who is always right) insists on continued...
>>>>
>>>>If the user has been informed that there's another way that's better and costs less of your time, and still insists on "Continued", then you have my condolences :-/
>>>
>>>Thanks!
>>
>>Well you can still have an expression like this:
>>
iif( _PAGENO < _PAGETOTAL, "continued", "")
>
>No you can't. For example, in a 66 page report, if the header changes on page, 3, 54 and 62, then the word 'Continued' would appear on every page, except for page 1, 3, 54 and 62 (assuming there is a page break every time the header changes).

Worse: it would appear on every page but the last, because I misread your requirements. So this is wrong.

Perhaps try to set a variable to SectionCode in the group header... the code would be like this: in the code to run the report, have a

lcLastSection=SectionCode
lcSuffix=""

Then in the group header the code would be like this

lcSuffix= iif( lcLastSection=SectionCode, " (continued)", "")
lcLastSection=SectionCode

And the expression in the header now becomes

'Section' + SectionCode +lcSuffix

The code in the group header would set the suffix to "" whenever the section changed, or to "cont.." when it stayed the same, on the condition that 1) the code runs before the header is rendered, 2) it runs only once per header per page, 3) you're on the first record before running the report.

Now my knowledge of VFP's reports is rather rusty - I think I haven't written anything more complex than a simple list for about a decade - but I seem to remember that for the sake of rendering this and that VFP may run the code inside the report several times, so the condition (2) may not be satisfied. You may fiddle with _pageno, though, and do lcLastSection assignment only when _pageno has changed (compared to a previous value you stored in a variable after the assignment).

Actually, this is still not good. This would compare the SectionCode on top of the page with that of the previous page, while you need to compare it with the one on next page, to see if it WILL change. IOW, on top of the page you need to know the condition which would be evaluate on top of the next page. If you don't know the number of records that fit one page, you can't really know which record it will be when the next page prints, i.e. you don't know whether the group finishes on the current page or not. So... I think it's kind of unsolvable.

Unless you have two versions of the report :). One that would fill the page numbers for each record while the report runs, or at least store the pagecount for each SectionCode into a cursor, then run the second one which uses these values to know whether the current group ends on the current page or not. The two reports would have the exactly same heights of everything...

update (i.e. another smart idea that you may try to implement :):

Fox will run the report for you twice if you use _pagetotal anywhere. You may check how does this variable behave during the first run - I guess it would keep the value it had before running the report. So... if it's equal to that value, it's a first run and you just fill the cursor; if it's changed, you use that cursor.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform