Antonio,
I made this small test-function
- Code: Select all Expand view RUN
#include "Fivewin.ch"
Procedure Main()
LOCAL oPrn, oPrint,oFnt, cPrinter := ""
LOCAL oWnd, oBrw
LOCAL aPrn := {}
LOCAL cDef, i := 1
aPrn := GetPrinters ()
IF Empty (aPrn)
MsgAlert ("No Printers found" )//+ CRLF +;
RETURN
ENDIF
cDef := GetDefaultPrinter()
DEFINE DIALOG oWnd FROM 2, 2 TO 21, 50 TITLE "Available Printers"
@ 1, 2 LISTBOX oBrw FIELDS aPrn[ i ] ;
HEADERS "Printer Array" ;
FIELDSIZES 200 ;
OF oWnd ;
SIZE 100, 100
oBrw:bGoTop = { || i := 1 }
oBrw:bGoBottom = { || i := Eval( oBrw:bLogicLen )}
oBrw:bSkip = { | nWant, nOld | nOld := i, i += nWant, ;
i := Max( 1, Min( i, Eval( oBrw:bLogicLen ) ) ),;
i - nOld }
oBrw:bLogicLen = { || Len( aPrn ) }
oBrw:cAlias = "Array" // Just put something
@ 7.8,2 SAY "Default printer: " + cDef
@ 1,22 BUTTON "&Print" OF oWnd ACTION Testprint (aPrn[i])
@ 2,22 BUTTON "&End " OF oWnd ACTION oWnd:End()
ACTIVATE DIALOG oWnd CENTERED
RETURN
//--------------------------------------------------------------
PROCEDURE TestPrint(cPrn)
LOCAL oFnt, oPrint
LOCAL cText := "Dies ist ein Testtext zum Drucken"
IF MsgYesNo ("Print to " + cPrn)
PRINT oPrint NAME "Formular" TO (cPrn)
DEFINE FONT oFnt NAME "ARIAL" SIZE 0,12 OF oPrint
oPrint:SetCopies (2)
oPrint:SetLandscape()
oPrint:Setup () // check the settings
PAGE
oPrint:CmSay (1,1, cText,oFnt)
ENDPAGE
ENDPRINT
oFnt:End()
ENDIF
RETURN
Everything seems to be fine, the printer is correct, the settings are correct (2 copies, landscape), but the printer ignores these settings. It prints only 1 copy in portrait.
I tested it on 2 computers, with local printers an network printers, always just 1 copy.
Printing from Word works fine with 2 copies.
Is anyone able, to print more than 1 copy with this code ?