Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplex report
Message
De
03/04/2000 16:26:34
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Divers
Thread ID:
00349630
Message ID:
00354550
Vues:
18
This message has been marked as a message which has helped to the initial question of the thread.
Hi Nadya. I wrote Fox Power Printer. The demo form is a little overkill (it shows a lot of features).

About duplexing, most printers that support duplexing support Book edge (just like any book, the long edge of the paper is used as the flip point), and tablet edge (the short edge of the paper is used as the flip point).

What you would do with Fox Power Printer (FPP) is include the fpp.vcx in your project and put the following code before you print.
SET CLASSLIB TO fpp.vcx ADDITIVE

o = CreateObject("fpprptgen")

* Initalize the report to use the printer we want.  
* o.clPrinters holds an array of available printers.
o.clInitalizeReport("bigreport.frx", o.clDefaultPrinter)

o.clSetDuplex(3) && book edge

IF o.clFinalizeReport() = .T. AND o.clReportReady = .T.
 REPORT FORM (o.clReportForm) TO PRINTER NOCONSOLE
ENDIF

o.clCleanUp()

o = NULL
What FPP does in the code above, is it gets the default printer information about the printer you told it and then the o.clSetDuplex makes a change to the temporary printer settings.

When clFinalizeReport is called, a new report file is created in the user's temporary directory with the printer's default settings and is closed up so you can call the REPORT FORM command.

The last call to clCleanUp deletes the temporary report file and gets FPP ready for the next call.

I promise that this will work everytime, as long as the printer that is used in the clInitalizePrinter supports duplexing.

If you read the documentation, you will find that the FPPPRTINFO object included in the fpp.vcx will tell you everything about the printers installed on a machine at run-time. The following code shows how to find out if a printer supports duplexing.
SET CLASSLIB TO fpp.vcx ADDITIVE

o = CREATEOBJECT("fppprtinfo")

* fppprtinfo also has a clPrinters, which holds an array of printers installed.
o.clGetCaps(o.clDefaultPrinter)

IF ASCAN(o.clCaps, "duplex") > 0
 * Printer supports duplex printing.
 ELSE
 * Printer does not support duplex printing.
ENDIF

o = NULL
** You can scan for a print that supports duplexing with the following code:
o = CREATEOBJECT("fppprtinfo")

FOR x = 1 TO o.clPrinterCount
 
o.clGetCaps(x)

IF ASCAN(o.clCaps, "duplex") > 0
 * Here is a printer that supports duplexing.
ENDIF

ENDFOR
*---------

Well, thats quite a bit. There is a lot that FPP can do. Good luck.

Rob.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform