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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

report in duplex mode

Status
Not open for further replies.

mpastore

Programmer
Mar 12, 2003
568
US
Hi,

I have a report that I would like to make duplex. Can this be done programatically?

Thanks Mike

Mike Pastore

Hats off to (Roy) Harper
 

Pardon my ignorance, but what's a duplex report?

Do you mean you want to fit two columns of detail data on one page? Or something else?
 
Duplex is when the report prints on both sides of the paper.

Mike Pastore

Hats off to (Roy) Harper
 

Seems to be more related to the printer driver. If it allows to print double-sided printouts in general, the feature can probably be accessed programmatically somehow.

Otherwise, you can probably print first odd page numbers, using something like
REPORT FORM ... FOR _pageno%2#0
or
REPORT FORM ... FOR MOD(_pageno,2)#0

then use a message box to ask users if they have turned over the paper and ready to continue, then print odd pages the same way. Try if it works.
 
No, that did not work. The VFP documentation makes reference to the NOPAGEEJECT command for duplexing, but I can't figure out how to put it together.

Mike Pastore

Hats off to (Roy) Harper
 
OK, I found it on MSDN.

It refers not to NOPAGEEJECT command, but rather to NOPAGEEJECT keyword/clause in the REPORT FORM command, as in
Code:
[b]Enable Duplex Printing and Chain Multiple Reports[/b]
You can specify that printing does not continue on a new sheet at the end of printing a report by using the NOPAGEEJECT keyword in the REPORT command. Therefore, you can enable duplex printing to continue on the reverse side of a previous report.
and
Code:
NOPAGEEJECT 
Specifies that Visual FoxPro does not force a sheet eject at the end of a report and leaves the print job open. The next report printed is added to the open print job. 

You can use NOPAGEEJECT to set up duplex printing, that is, printing on the reverse side of a previous report.

It appears in Visual FoxPro starting version 8. I don't have it, I still use v.6, so cannot try this out.

Try also to take a look at PRTINFO() function, Duplex mode seems to be a printer mode which probably has to be set up along with REPORT FORM ... NOPAGEEJECT.
 
Mike,

I assume you want the a single report to be duplexed with itself (as opposed to Report 1 printed on the back of Report 2, etc).

If so, you don't need to do anything special to achieve that. The user just has to pick a printer that supports duplexing, and set the appropriate option in the printer properties.

There's no easy way to set that option programmatically. But there's an easy workaround -- assuming you have some control over the user's printer environemnt.

All you have to do is to install a second copy of the same printer driver, under a different name. In the second copy, make it default to duplexing. Then, you either programmatically select that printer (using SET PRINTER TO NAME), or you let the user do it via the printer dialogue.

This has worked for me in several projects.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 

If I save the printer information in my report after setting the duplex on in the printer driver I see the following:
DRIVER=winspool
DEVICE=\\sun.suntelcom.net\MTLHQ02PRNHPL01
OUTPUT=IP_192.168.100.98
ORIENTATION=0
PAPERSIZE=1
COPIES=1
DEFAULTSOURCE=7
PRINTQUALITY=600
COLOR=2
DUPLEX=2
YRESOLUTION=600
COLLATE=1

And if I send a two page report it will be duplexed.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
mgagnon, I also see this in my report. I think though the tag/tag2 binary fields also need to be updated in order to have duplex go dyanmically to other printers. The link stella gave me speaks to this. I'm doing additional testing and will post my results. Thanks

Mike Pastore

Hats off to (Roy) Harper
 
Hi,

Just a follow-up to last week's duplexing question. I found that if I do not save printer environment settings and keep the following in the .expr field of row 1 of the .frx file, any printer I point to will duplex, if it has that capability.

ORIENTATION=1
PAPERSIZE=1
COPIES=1
DEFAULTSOURCE=7
PRINTQUALITY=600
COLOR=2
DUPLEX=3
YRESOLUTION=600

We use HP4000's series.

Thanks to all for you help.

Mike Pastore

Hats off to (Roy) Harper
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top