Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Start Group at New page dynamically
Message
From
06/02/2006 07:29:39
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00991146
Message ID:
01093902
Views:
31
>
>Exists a simple way for do this:
>To begin the print of the Group from the new page in the case in the current
>is not possible to print it all
>(similar to Word when it is declared to maintain a paragraph united)
>
>I Task that need a tho phases report, but I would have to resolve the problem today.
>
>Lisa pardons to me, but task that if a solution exists, this is useful to many readers
>

>
>Yes it is possible to force a page break dynamically, although it is not particularly "simple" <s>.
>
>Fabio, I don't mind your asking, no apology needed, but if you need to solve something "today", you will have to write to me e-mail because (as you have probably noticed) I won't otherwise see your message <g>. You wrote this a year ago, didn't you?
>
Ok.

>FWIW this is not a new technique, so I've explained this for you and other "readers" a bunch of times, probably starting in Fox 2.x <s>. The basic idea goes like this:
>
>

    >
  1. -- create a group outer to the one you are trying to force to sometimes-break-on-page
    >
  2. -- the outer group causes new-page-on-break, and its expression is a report variable, let's call it ForcePageBreak
    >
  3. -- the ForcePageBreak report variable has these characteristics:
    >

      >
    • initial value 0
      >
    • value-to-store ForcePageBreak [its own name, IOW]
      >
    • reset value based on report [IOW, the report engine never changes it]
      >
    • no calculation
      >

    >
  4. increment the ForcePageBreak value explicitly when you want to force the page break. For example, I have used this code in the On Exit event of a detail band: EXECSCRIPT("ForcePageBreak = IIF([condition], ForcePageBreak+1, ForcePageBreak)"+CHR(13) )
    >

>
>... a UDF works well instead of the EXECSCRIPT, especially if you have a bunch more work to do at the same point in the report, or if your [condition] requires extensive evaluation. And, if you're working in VFP9 and can do the work in a reportlistener, that's good too.
>

_VFP.SetVar

>The On Exit of the detail band is not necessarily the right place to do it, and on occasion I've found it necessary to use an inner group rather than an outer group -- you have to experiment a bit with the conditions on which you are trying to force the page break to get it right for any individual report.
>
>HTH,
>
>>L<
Hi Lisa,

I have not understood very well ( inner outer group ? ).

But you suppose these cases:
Case 1:
I want to make to start a group in the new page
if the last detail line of the group contains the word "Lisa"

Case 2:
I want to make to start a group in the new page
if the last detail line of the following group contains the word "Lisa".

Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform