Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send a text file containing CHR(12) 's to the printer .
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00429558
Message ID:
00434426
Views:
13
Hi Bruce,

Thanks a lot for idea, actually, I have the similar idea, but haven't tried yet. The problem here is how would you know, where to insert your iPageNo=iPageNo+1? So my idea was a little bit more complicated:
1) Add a logical field called lRunOnce+ iPageNo
2) Run report first to a dummy file. In Group Footer add call to a function, like InsertPageBreaks.
3) In this function check pageno/2 and lRunOnce. If it's false (default state -first run), set it to be true and increment iPageNO, otherwise don't do anything.

It's just an idea, but seems to be a good one, unless we find something simpler...

>Nadya,
>
>At the suggestion of Trey Walpole, I got my VFP report to put page breaks where I wanted them by modifying the cursor being reported upon, and by putting a new "grouping" in the report itself.
>
>I added an integer column named iPageNo to my cursor, and in the Report Designer, created a group on this column, and set it to "begin a new page" when the group changes. Then, after retrieving data, but before running the report, I "pre-processed" the cursor with a SCAN...ENDSCAN loop, something like this:
>
>*- Fetch data, adding a field for the page number
>SELECT Customer.*, 0 AS iPageNo ;
> FROM Customer ;
> INTO CURSOR cu_Rept
>
>*- Pre-process the data, setting page breaks as desired
>liCurPage = 0
>SCAN
> IF < expression >
> liCurPage = liCurPage + 1
> REPLACE iPageNo WITH liCurPage
> ENDIF
>ENDSCAN
>
>REPORT FORM ...
>
>From your description, I think this will work. It doesn't matter that the iPageNo column does not contain the *actual* page numbers - only that it indicates a *change*, triggering the report designer to control-break on that row. So these page breaks should be in addition to the "natural" ones caused by data flowing from one page to the next, per your example.
>
>I hope this helps.
>
>- Bruce Allen
>
>
>>May be you can help me with the problem, I put aside for a while. I have one idea to try, but it seems to be complicated, may be you know better ways. I have a report designed in VFP report writer. The report itself is quite complicated. I have to insert a blank page, if group ends on odd number in order to print each group from the new page, IOW, if the user uses both sides of page to print it should be like:
>>Group1
>>Page1
>>Page2
>>Page3
>>Empty Page
>>
>>Group2
>>Page1
>>Empty page
>>
>>Group3
>>Page1
>>Page2
>>
>>etc.
>>
>>Do you have ideas, how can I do this?
>>
>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform