Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically Printing a Blank Page in VFP 7

Status
Not open for further replies.

ggrewe

IS-IT--Management
Jul 10, 2001
169
US
Folks,

Does anyone know of a way I can print a blank page or do a page eject when the end of a report group is reached and it is an odd page? I have tried adding
Code:
IIF(MOD(_pageno,2)<>0, EJECT PAGE, "")
to the group footer on exit expression to no avail.

I have done something like
Code:
FOR i = 1 TO 10
  REPORT FORM XXX FOR DISTRICT = i TO PRINTER PROMPT
  IF MOD(_PAGENO,2)<>0
    REPORT FORM BLANK_PAGE TO PRINTER
  ENDIF

ENDSCAN
This is cumbersome because we are duplexing the report and I get prompted for the printer settings everytime. Then the the blank page is not printed on the reverse side of the reports last page, a new page is printed. Which works out, but wastes paper.

I have tried wrapping the above with

PRINTJOB ... ENDPRINTJOB

Prompting for the first report and then doing the for loop, but since I am using some printer quick sets on the printers, this does not seem to hold the duplex and output settings.

It appears VFP8 and 9 can handle this better, but for now... thanks in advance.



Greg Grewe
West Chester, Ohio
 

Greg,

Your code looks like it should work:

Code:
REPORT FORM XXX FOR DISTRICT = i TO PRINTER PROMPT
  IF MOD(_PAGENO,2)<>0
    REPORT FORM BLANK_PAGE TO PRINTER
  ENDIF

Except, instead of a sending a new report to create a blank page, why not just do an EJECT (not EJECT PAGE). In other words:

Code:
REPORT FORM XXX FOR DISTRICT = i TO PRINTER PROMPT
  IF MOD(_PAGENO,2)<>0
    EJECT
  ENDIF

Of course, you'll need to be sure the EJECT is going to the same printer as the report. So you could alter the whole thing as follows:

Code:
SET PRINTER TO NAME GETPRINTER()
SET PRINTER ON
REPORT FORM XXX FOR DISTRICT = i TO PRINTER  
IF MOD(_PAGENO,2)<>0
    EJECT
ENDIF
SET PRINTER TO
SET PRINTER OFF

I haven't tested this, but it might be worth a try.

Mike





__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks much Mike, I will try it this evening and let you know.



Greg Grewe
West Chester, Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top