05 Jul 2012 21:03
Win_PrintFileRaw(Win_PrinterGetDefault(),mTmpFile,"JPA Relatorio " + m_Prog)
Function SelecionaImpressora()
Local aPrinterList := {}, nOpc := 1, lCancel := .f.
aPrinterList := Win_PrinterList()
For nCont = 1 To Len(aPrinterList)
If aPrinterList[nCont] == Win_PrinterGetDefault()
nOpc := nCont
Exit
Endif
Next
wAchoice(6,Int(MaxCol()/4),aPrinterList,@nOpc,"Impressora a utilizar")
lCancel := ( LastKey() == 27 )
If .Not. lCancel
Win_PrinterSetDefault(aPrinterList[nOpc])
Endif
Return lCancel
08 Jul 2012 14:24
09 Jul 2018 09:55
09 Jul 2018 10:26
...
...
cPrinterName:='c:\temp\arquivo.txt'
nResult := PrintFileRaw( cPrinterName, cFile, "Impressao Pelo Sistema" )
IF nResult = -1
cMsg = "Parametros inválido, Favor Tentar Novamente"
ELSEIF nResult = -2
cMsg = "Falha na chamada da Impressora, Favor Verificar a Impressora"
ELSEIF nResult = -3
cMsg = "Falha ao Iniciar Impressão, Favor Verificar a Impressora"
ELSEIF nResult = -4
cMsg = "Falha ao Iniciar a Primeira Pagina, Favor Verificar a Impressora"
ELSEIF nResult = -5
cMsg = "Falha de Memoria da Impressora, Favor Verificar a Impressora"
ELSEIF nResult = -6
cMsg = "Não foi Possivel localizar o arquivo de Impressão, Favor Tentar Novamente"
ENDIF
11 Jul 2018 10:36
FUNCTION SELECT_PRINT(cARQTXT)
LOCAL nPrn:=1
LOCAL aPrn:= GetPrinters()
SETMODE(25,80)
CLS
IF EMPTY(cARQTXT)
Alert("Obrigatorio informar o arquivo")
quit
ENDIF
IF EMPTY(aPrn)
aOptions := { "SIM", "NAO" }
nChoice := Alert( "ATEN€ÇO !!! NÆo foi possivel localizar nenhuma impressora Instalada, Deseja Instalar uma Agora ?", aOptions, , 5)
DO CASE
CASE nChoice == 0
QUIT
CASE nChoice == 1
RunApplet_imp( "AddPrinter" )
CASE nChoice == 2
QUIT
ENDCASE
ENDIF
DO WHILE !EMPTY(nPrn)
CLS
@ 0,0 SAY 'Escolha uma impressora. ESC' +;
' para sair.'
@ 1,0 TO maxRow(),maxCol()
nPrn:= ACHOICE(2,1,maxRow()-1,maxCol()-1,aPrn,.T.,,nPrn)
IF !EMPTY(nPrn)
PrnTest(aPrn[nPrn], cARQTXT )
ENDIF
ENDDO
@ 22,00 say ""
RETURN(NIL)
11 Jul 2018 11:27
12 Jul 2018 08:23