Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert blank page if page group finishes on the odd page
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00444634
Message ID:
00447085
Vues:
32
>>I'm glad to telly you, that I finally found a way to achieve the desired functionality. I used my 'kludgy' idea + really helpful John Koziol article in FoxTalk. Now it works like a charm. If you're curios, I'll send this report to you (BTW, my manager yesterday requested bunch of new additions, which I already made using hacking frx).
>>
>>Thanks for your help and ideas, they really forced me to work harder :)
>
>
>Nadya,
>
>I'd be interested in knowing how you achieved this.
>
>Thanks,
>Cathy

Ok, I'll try to explain you the idea and if you're really interested, I'll send you the report+test file too.

In the Group Entry I call this function:
********************************************************************
*  Description.......: FSetTownsEnd - function used in MTDReport
*  Calling Samples...:
*  Parameter List....:
********************************************************************
if mod(_pageno,2)>0 and not EmptyPage && Last page is odd
*if repTown<>town
*        OddPage=OddPage+1 && Increment OddPage variable
*endif
*        eject
*!*        set printer to && (NT4 & VFP6) Ends print spooling and should cause printing to start.
     replace EmptyPage with .t., TotPages with _pageno
     if right(city,1)<>'Z'
          ccode=ccode
          city=padr(alltrim(city),20,'Z') && Would be next in sequence
          street=replicate('z',25)
          append blank
          gather memvar
     endif
endif
TownEnd=.t.
return TownEnd
In the table I added two additional work fields: EmptyPage (logical), TotPages I
(actually, I may add three fields). I have group by city, city is Char 20, but actually, I don't have city that long, so I'm sure, that I always can add Z at the end of city. My order is situs: ccode+city+street+...
I start each group on the new page. Now, I have fake groups, like BroklineZZZZZZZZZ. This group would start from the first page. I change print when condition for all report objects (by hacking frx) to be old PrintWhen and street<>replicate('z',25) (I don't have streets with all zzz in the real file).

Therefore it puts a blank page, as I desired.
Quite complicated, but works like a charm and this is that really matters!
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform