Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print check stub 2x (print detail twice)
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01165954
Message ID:
01166493
Views:
17
One slight option I would do to #2 would be to have a cursor with just ChkDate, InvNo, Amt, etc... AND a field for LineNumber... and have it force creating ex: a max of 10 rows instead of hard-coding 40-50-60 fields... If you only fill in 4 rows of stuff, just add 6 (or whatever needed) blank rows -- and their second stub equivalent. Finally, add one MORE field on the record so when you create the duplicates (for the second stub), you have a multiplication factor 1 or 0... so on running your calcs, you can still to a SUM(InvAmt * MultFactor) instead of just Sum(InvAmt)... This way, you won't double-count in your totals.


>You have a few options ...
>
>#1 - Create a cursor that has two sets of detail lines with another extra field called StubNo so you can do a data group on Check Number and another one on Check Number + Stub Number. The check itself goes in the data group header for Check Number. The data group header and footer for Stub Number is used to fudge the spacing for the two stubs. When building this cursor you have to put dummy lines to fill up the stub with exactly the right number of lines. You also have to take great care to deal with a check that might overflow to a 2nd page.
>
>#2 - (This is the method that I describe in my book). Create one giant record with all the check information and stub information. For example, if the stub contains up to 10 lines of invoice information you would have fields named Date1, Date2, Date3... Date10, InvNo1, InvNo2, InvNo3...InvNo10, Amt1, Amt2... Amt10. And so on and so on. In the report definition you basically make one giant detail band as tall as the page (or as close as possible). Then you add all the fields stacked on top of each in the stub area .. Date1, Date2, etc.
>
>#3 - Upgrade to VFP 9 and you could do this with a report listener. Use a directive in the report definition for all the stub fields. In the Render method of the listener, have it render the stub object twice .. once where it's defined and a second time using an offset to print it farther down the page.
Previous
Reply
Map
View

Click here to load this message in the networking platform