Setting printer to duplex-mode programmatically 
Author Message
 Setting printer to duplex-mode programmatically

Hi,

I'm using VFP 6.

I have a lot of different reports wich are printed in batch.  Some of them
must be printed in simplex mode and other in duplex mode, but all on the
same (default) printer.

Is there a way I can change the printer setting programmatically in order to
set the Duplex mode?

I know it can be done manually with SYS(1037), but as I said, the reports
are printed in batch at night.

If possible, I need a quick answer,

Thank you very much

Stephane Plante



Sat, 20 Dec 2003 21:06:16 GMT  
 Setting printer to duplex-mode programmatically
Stephane,

Just did it.  Simple.

Suppose your printer name is MyPrinter
Define another printer with the same drivers and printing on the same port,
named eg MyprinterDuplex
Then, set the defaults (setup) of MyprinterDuplex to print in duplex whilst
Myprinter defaults to one sided

Prior to launching the report

local DuplexMode
&& set DuplexMode to either TRUE or FALSE

set printer to name (iif(DuplexMode, 'MyprinterDuplex', 'MyPrinter'))

report ....

hth
Gregory
----------------

| Hi,
|
| I'm using VFP 6.
|
| I have a lot of different reports wich are printed in batch.  Some of them
| must be printed in simplex mode and other in duplex mode, but all on the
| same (default) printer.
|
| Is there a way I can change the printer setting programmatically in order
to
| set the Duplex mode?
|
| I know it can be done manually with SYS(1037), but as I said, the reports
| are printed in batch at night.
|
| If possible, I need a quick answer,
|
| Thank you very much
|
| Stephane Plante

|
|
|



Sat, 20 Dec 2003 21:51:46 GMT  
 Setting printer to duplex-mode programmatically
Stephane,

Just did it.  Simple.

Suppose your printer name is MyPrinter
Define another printer with the same drivers and printing on the same port,
named eg MyprinterDuplex
Then, set the defaults (setup) of MyprinterDuplex to print in duplex whilst
Myprinter defaults to one sided

Prior to launching the report

local DuplexMode
&& set DuplexMode to either TRUE or FALSE

set printer to name (iif(DuplexMode, 'MyprinterDuplex', 'MyPrinter'))

report ....

hth
Gregory
----------------


| Hi,
|
| I'm using VFP 6.
|
| I have a lot of different reports wich are printed in batch.  Some of them
| must be printed in simplex mode and other in duplex mode, but all on the
| same (default) printer.
|
| Is there a way I can change the printer setting programmatically in order
to
| set the Duplex mode?
|
| I know it can be done manually with SYS(1037), but as I said, the reports
| are printed in batch at night.
|
| If possible, I need a quick answer,
|
| Thank you very much
|
| Stephane Plante

|
|
|



Sat, 20 Dec 2003 21:54:40 GMT  
 Setting printer to duplex-mode programmatically
Gregory,

    Thanks for your hint, but sadly, I can't define twice the same printer
on one computer because it's a network printer and the network policies on
our network forbid this.

Would there be any other way?

Stephane



Quote:
> Stephane,

> Just did it.  Simple.

> Suppose your printer name is MyPrinter
> Define another printer with the same drivers and printing on the same
port,
> named eg MyprinterDuplex
> Then, set the defaults (setup) of MyprinterDuplex to print in duplex
whilst
> Myprinter defaults to one sided

> Prior to launching the report

> local DuplexMode
> && set DuplexMode to either TRUE or FALSE

> set printer to name (iif(DuplexMode, 'MyprinterDuplex', 'MyPrinter'))

> report ....

> hth
> Gregory



Sat, 20 Dec 2003 22:19:31 GMT  
 Setting printer to duplex-mode programmatically
Stephane,

Any other way ?  Not that I know of.  Maybe via api.  But then that will be
for the api gurus.

may be try to have the printer defined twice with a different name.

I am sorry

Gregory
------

| Gregory,
|
|     Thanks for your hint, but sadly, I can't define twice the same printer
| on one computer because it's a network printer and the network policies on
| our network forbid this.
|
| Would there be any other way?
|
| Stephane
|

message

| > Stephane,
| >
| > Just did it.  Simple.
| >
| > Suppose your printer name is MyPrinter
| > Define another printer with the same drivers and printing on the same
| port,
| > named eg MyprinterDuplex
| > Then, set the defaults (setup) of MyprinterDuplex to print in duplex
| whilst
| > Myprinter defaults to one sided
| >
| > Prior to launching the report
| >
| > local DuplexMode
| > && set DuplexMode to either TRUE or FALSE
| >
| > set printer to name (iif(DuplexMode, 'MyprinterDuplex', 'MyPrinter'))
| >
| > report ....
| >
| > hth
| > Gregory
|
|



Sat, 20 Dec 2003 22:47:46 GMT  
 Setting printer to duplex-mode programmatically
Stephane,

Any other way ?  Not that I know of.  Maybe via api.  But then that will be
for the api gurus.

may be try to have the printer defined twice with a different name.

Or maybe duplicate your report and do the Page setup differently for the
second

Gregory
-------

| Gregory,
|
|     Thanks for your hint, but sadly, I can't define twice the same printer
| on one computer because it's a network printer and the network policies on
| our network forbid this.
|
| Would there be any other way?
|
| Stephane
|

message

| > Stephane,
| >
| > Just did it.  Simple.
| >
| > Suppose your printer name is MyPrinter
| > Define another printer with the same drivers and printing on the same
| port,
| > named eg MyprinterDuplex
| > Then, set the defaults (setup) of MyprinterDuplex to print in duplex
| whilst
| > Myprinter defaults to one sided
| >
| > Prior to launching the report
| >
| > local DuplexMode
| > && set DuplexMode to either TRUE or FALSE
| >
| > set printer to name (iif(DuplexMode, 'MyprinterDuplex', 'MyPrinter'))
| >
| > report ....
| >
| > hth
| > Gregory
|
|



Sat, 20 Dec 2003 22:51:17 GMT  
 Setting printer to duplex-mode programmatically
in report designer, set up for duplex mode
close
open frx as table
note settings in 1st record Expr
repeat above for not duplex mode

there should be only 1 line difference

in code, reset this line as necessary

al


Quote:
> Hi,

> I'm using VFP 6.

> I have a lot of different reports wich are printed in batch.  Some of them
> must be printed in simplex mode and other in duplex mode, but all on the
> same (default) printer.

> Is there a way I can change the printer setting programmatically in order
to
> set the Duplex mode?

> I know it can be done manually with SYS(1037), but as I said, the reports
> are printed in batch at night.

> If possible, I need a quick answer,

> Thank you very much

> Stephane Plante




Sun, 21 Dec 2003 04:33:23 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Change printer setting of report form programmatically

2. How to programmatically set the Page length of a dot matrix printer

3. Setting printer to landscape mode?

4. Setting the Default Printer Programmatically in VP5.0

5. FPW & Duplex Printers

6. Start new page when printing to duplex printer

7. Duplex printer using VFP5.0 Report Writer

8. FPW2.6 printing to network printer w/SET DEVICE TO PRINTER

9. VFP use setting of default printer for all printers - help

10. SET PRINTER TO NAME doesn't necessarily send reports to the correct printer

11. How to set a printer as a default printer using VFP

12. SET PRINTER TO \\machine\printer

 

 
Powered by phpBB® Forum Software