Não sei o que acontece, mas ora não nem está criando o arquivo, ora está criando o arquivo com tamanho zero.
Alguém saberia me dizer por que?
Verifiquei que a Win_PrintFileRaw está retornando 1.
Segue abaixo o que importa da função:
Código: Selecionar todos
function imprelat
local nLf :=1
private cPrinter
private aPNomes := {}
cls
@ 15,5 say "Imprimindo; aguarde..."
erase arqprint.tmp
set printer to "arqprint.tmp"
set devi to print
dbsel("SELECT * FROM audiencias WHERE processo='"+proc+"'", "imprelat",nProvAudiencias)
nVer:= 22
nHor:= 16
nTam:= 7
@ nLf,2 say Chr(27)+"(s4H"
@ nLf,2 say Chr(27)+"&d1D"
@ nLf,2 say "Relatório de audiência do dia";nLf++
nLf++
@ nLf,2 say dtoc(data)+" às "+alltrim(hora)+"h"
nLf++
nLf++
nLf++
@ nLf,2 say Chr(27)+"(s9H"
@ nLf,2 say Chr(27)+"&d@"
nLf++
nLf++
@ nLf,5 say "Observaçoes: "+substr(observacoes,1,48)
a=49
....
cls
private aPrn := Win_PrinterList( .t., .f. )
escimpr()
If !Empty( cPrinter )
?Win_PrintFileRaw( cPrinter, "ArqPrint.Tmp", "Rel.pdf" )
Endif
set devi to scre
set printer to
return


