Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form Feeds in report designer
Message
 
To
18/06/2002 22:50:32
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00669987
Message ID:
00670080
Views:
21
This message has been marked as the solution to the initial question of the thread.
>Hi All,
>
>I have a report that requires me to issue an extra (in addition to "Start each group on a new page") form feed if it is an odd page number [Mod(_PageNo,2)#0]. I've tried putting a field Chr(12) in the group footer but is just prints out a square. Any suggestions?
>
>Aloha,
>
>James

James,

Here's a method I describe in my new book:

- Make sure the "Start group on new page" box is checked.
- Add a field object to the Group Footer band with the following expression: IIF(MOD(_PAGENO, 2) = 0, '', REPLICATE(CHR(13), 40))
- Check the "Stretch with overflow" checkbox and the "Remove line if blank" checkbox on this object

The number "40" is just a number I used for an example and you may have to adjust yours. It represents how many lines lines would fit on the page. This way .. if only 1 detail band prints .. the 40 CHR(13)s would cause the Group Footer to not fit .. therefore, it does a page feed and prints the "blank lines" on the next page.

One catch with this trick is that the last group will also print a blank page. If you aren't printing doublesided, this is probably not what you want. To avoid the extra blank page, you can use the following code to print the report:
PRIVATE pnLastRec
USE MyData
GOTO BOTTOM
pnLastRec = RECNO()

GOTO TOP
REPORT FORM MyReport TO PRINTER PROMPT PREVIEW
Now, change the expression for the new object to the following: IIF(MOD(_PAGENO, 2) = 0 OR RECNO() = pnLastRec, '', REPLICATE(13), 40))


I hope this helps!
Cathy
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform