PrintFileRaw() também não funciona.
Eu já havia postado acima um trecho da função, mas vou postar agora ela inteira:
Código: Selecionar todos
function imprelat
clear
@ 5,5 say "Antes de iniciar a impressão, coloque na impressora papel rascunho"
inkey(8)
do case
case file("\windows\inforum.cpd")
set printer to "Lexm332n"
case file("\windows\est1.dbf")
set printer to "Lexmark E332n"
otherwise
set printer to "Lexmark E332 N"
endcase
set devi to print
vezimp=0
do while .t.
nLf=1
if vezimp>1
exit
endif
@ 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(dtaud)+" às "+alltrim(hraud)+"h"
@ nLf,2 say Chr(27)+"(s9H"
@ nLf,2 say Chr(27)+"&d@"
nLf++
nLf++
nrproc=processo
if at(" ",processo)=0
@ nLf,5 say "Processo número: "+substr(processo,1,4)+"/"+substr(processo,5,5)+"-"+substr(processo,10)
else
@ nLf,5 say "Processo número: "+substr(processo,1,4)+"/"+substr(processo,5,at(" ",processo)-6)+"-"+substr(processo,at(" ",processo)-1,1)
endif
nLf++
nLf++
sele 2
if usebase(cpd+"reus")=.t.
locate for processo=nrproc
if found()
@ nLf,5 say "Réu: "+reu;nLf++
do while .t.
skip
if eof()
exit
endif
if processo=nrproc
@ nLf,11 say reu;nLf++
endif
enddo
endif
endif
use
sele 1
nLf++
@ nLf,5 say "Data do fato: "+dtoc(dtfato);nLf++;nLf++
@ nLf,5 say "Data do recebimento da denúncia: "+dtoc(dtrecebim);nLf++;nLf++
if dtfato<ctod("01/01/2008") .and. !empty(dtfato) //at("2010",processo)#1 .and. at("2009",processo)#1 .and. at("2008",processo)#1
nLf++
@ nLf,3 say Chr(27)+"(s6H"
@ nLf,3 say "Conferir prescrição:";nLf++
@ nLf,3 say Chr(27)+"(s9H"
nLf++
@ nLf,5 say "Art. 109. ...";nLf++ // A prescri╬Æo, antes de transitar em julgado a senten╬a";nLf++
@ nLf,5 say "I - em vinte anos, se o máximo da pena é superior a doze;";nLf++
@ nLf,5 say "II - em dezesseis anos, se o máximo da pena é superior a oito anos";nLf++
@ nLf,5 say "e não excede a doze;";nLf++
@ nLf,5 say "III - em doze anos, se o máximo da pena é superior a quatro anos";nLf++
@ nLf,5 say "e não excede a oito;";nLf++
@ nLf,5 say "IV - em oito anos, se o máximo da pena é superior a dois anos";nLf++
@ nLf,5 say "e não excede a quatro;";nLf++
@ nLf,5 say "V - em quatro anos, se o máximo da pena é igual a um ano ou,";nLf++
@ nLf,5 say "sendo superior, não excede a dois;";nLf++
@ nLf,5 say "VI - em 3 (três) anos, se o máximo da pena é inferior a 1 (um) ano.";nLf++
nLf++
endif
nLf++
id=memotran(alltrim(suspensao),[ ],[ ])
if !empty(id)
@ nLf,0 say Chr(27)+"(s7H"
nLf++
@ nLf,4 say "Suspensão do processo: "+substr(id,1,24)
nLf++
k=25
do while .t.
if alltrim(substr(id,k,25))==""
exit
else
@ nLf,28 say substr(id,k,20)
nLf++
k=k+20
endif
enddo
else
nLf++
@nLf,5 say "Não teve suspensão do processo"
nLf++
nLf++
endif
@ nLf,0 say Chr(27)+"(s9H"
nLf++
id=memotran(alltrim(observac),[ ],[ ])
if !empty(alltrim(id))
@ nLf,0 say Chr(27)+"(s6H"
@ nLf,3 say "Observações: "+substr(id,1,26)
k=27
nLf++
do while .t.
if alltrim(substr(id,k,26))==""
exit
else
@ nLf,18 say substr(id,k,26)
nLf++
k=k+26
endif
enddo
endif
@ nLf,0 say Chr(27)+"(s9H"
nLf++
if !empty(aditamento)
@ nLf,0 say Chr(27)+"(s6H"
@ nLf,5 say "Aditamento da denúncia às fls. "+aditamento; nLf++
@ nLf,0 say Chr(27)+"(s9H"
endif
nLf++
nLf++
@ nLf,5 say "Tipo da denúncia: "+substr(tipoimput,1,45);nLf++
@ nLf,23 say substr(tipoimput,46,45);nLf++
@ nLf,23 say substr(tipoimput,91,45);nLf++
@ nLf,23 say substr(tipoimput,136,45);nLf++
@ nLf,23 say substr(tipoimput,181);nLf++
nLf++
for k:= 1 to mlcount(alltrim(tipoden),64)
@ nLf,5 say memoline(memotran(alltrim(tipoden),[ ],[ ]),64,k,,.f.); nLf++
next
@ nLf,0 say Chr(27)+"(s6H"
nLf++
nLf++
@ nLf,4 say "Resumo dos fatos da denúncia:";nLf++;nLf++
@ nLf,0 say Chr(27)+"(s9H"
k=1
for k:= 1 to mlcount(alltrim(fatoden),64)
@ nLf,6 say memoline(memotran(alltrim(fatoden),[ ],[ ]),64,k,,.f.); nLf++
next
nLf++
nLf++
@ nLf,2 say Chr(27)+"(s6H"
@ nLf,3 say "Alegações dos réus:"
@ nLf,2 say Chr(27)+"(s9H"
nLf++
@ nLf,5 say chr(218)+replicate(chr(196),63)+chr(191);nLf++
sele 2
if usebase(cpd+"reus")=.t.
locate for processo=nrproc
if found()
do while .t.
if processo#nrproc
exit
endif
if eof()
exit
endif
if empty(substr(reu,20))
@ nLf,5 say chr(179)+alltrim(reu)+":"
@ nLf,30 say chr(179)
else
@ nLf,5 say chr(179)+substr(reu,1,21)
@ nLf,30 say chr(179)
@ nLf,69 say chr(179); nLf++
@ nLf,5 say chr(179)+alltrim(substr(reu,22))+":"
@ nLf,30 say chr(179)
endif
@ nLf,32 say "Data de nascimento: "+dtoc(dtnascim)
@ nLf,69 say chr(179); nLf++
@ nLf,5 say chr(179)+"Foto: fl. "+foto
@ nLf,30 say chr(179)
@ nLf,69 say chr(179); nLf++
@ nLf,5 say chr(179)
@ nLf,30 say chr(179)
@ nLf,32 say "Interr. policial à fl. "+alltrim(flsintdel)+": "
@ nLf,69 say chr(179); nLf++
@ nLf,5 say chr(179)+"Antecedentes: "
@ nLf,30 say chr(179)
@ nLf,69 say chr(179); nLf++
id=memotran(alltrim(intdel),[ ],[ ])
ant=memotran(alltrim(anteced),[ ],[ ])
k=1
y=1
do while .t.
if alltrim(substr(id,k,32))=="" .and. alltrim(substr(ant,y,22))==""
exit
else
@ nLf,5 say chr(179)+substr(ant,y,22)
@ nLf,30 say chr(179)+" "+substr(id,k,32)
@ nLf,69 say chr(179); nLf++
k=k+32
y=y+22
endif
enddo
if !empty(flsintju)
@ nLf,5 say chr(179)
@ nLf,30 say chr(179)
@ nLf,69 say chr(179)
nLf++
@ nLf,5 say chr(179)
@ nLf,30 say chr(179)
id=memotran(alltrim(intju),[ ],[ ])
@ nLf,32 say "Interrogatório judicial: fls. "+flsintju
@ nLf,69 say chr(179); nLf++
k=1
do while .t.
if alltrim(substr(id,k,32))==""
exit
else
@ nLf,5 say chr(179)
@ nLf,30 say chr(179)+" "+substr(id,k,32)
@ nLf,69 say chr(179); nLf++
k=k+32
endif
enddo
endif
@ nLf,5 say chr(192)+replicate(chr(196),63)+chr(217);nLf++
skip
enddo
endif
endif
use
sele 1
nLf++
@ nLf,3 say Chr(27)+"(s6H"
@ nLf,3 say "Testemunhas de acusação:"
@ nLf,3 say Chr(27)+"(s9H"
nLf++
nLf++
nrtest=1
do while .t.
if nrtest>14
exit
endif
if !empty(fieldget(fieldpos("testem"+alltrim(str(nrtest)))))
@ nLf,5 say chr(218)+replicate(chr(196),63)+chr(191);nLf++
if empty(substr(fieldget(fieldpos("testem"+alltrim(str(nrtest)))),22))
@ nLf,5 say chr(179)+alltrim(fieldget(fieldpos("testem"+alltrim(str(nrtest)))))+":"
@ nLf,30 say chr(179)
else
@ nLf,5 say chr(179)+substr(fieldget(fieldpos("testem"+alltrim(str(nrtest)))),1,20)
@ nLf,30 say chr(179)
@ nLf,69 say chr(179); nLf++
if empty(substr(fieldget(fieldpos("testem"+alltrim(str(nrtest)))),41))
@ nLf,5 say chr(179)+alltrim(substr(fieldget(fieldpos("testem"+alltrim(str(nrtest)))),21))+":"
else
@ nLf,5 say chr(179)+alltrim(substr(fieldget(fieldpos("testem"+alltrim(str(nrtest)))),21,20))
@ nLf,30 say chr(179)
@ nLf,69 say chr(179); nLf++
@ nLf,5 say chr(179)+alltrim(substr(fieldget(fieldpos("testem"+alltrim(str(nrtest)))),41))+":"
endif
@ nLf,30 say chr(179)
endif
flsouvju="ouvju"+alltrim(str(nrtest))
do case
case !empty(fieldget(fieldpos(flsouvju)))
@ nLf,32 say "Já foi ouvida em juízo à fl. "+&flsouvju
@ nLf,69 say chr(179); nLf++
case !empty(fieldget(fieldpos("desist"+alltrim(str(nrtest)))))
@ nLf,32 say "Houve desistência à fl. "+fieldget(fieldpos("desist"+alltrim(str(nrtest))))
@ nLf,69 say chr(179); nLf++
otherwise
@ nLf,32 say "Depoimento policial à fl. "+alltrim(fieldget(fieldpos("ouvdel"+alltrim(str(nrtest)))))+":"
@ nLf,69 say chr(179); nLf++
@ nLf,5 say chr(179)
@ nLf,30 say chr(179)
@ nLf,69 say chr(179); nLf++
id=memotran(alltrim(fieldget(fieldpos("depdel"+alltrim(str(nrtest))))),[ ],[ ])
k=1
do while .t.
if alltrim(substr(id,k,35))==""
exit
else
@ nLf,5 say chr(179)
@ nLf,30 say chr(179)+" "+substr(id,k,35)
@ nLf,69 say chr(179); nLf++
k=k+35
endif
enddo
endcase
@ nLf,5 say chr(179)
@ nLf,30 say chr(179)
@ nLf,69 say chr(179)
nLf++
@ nLf,5 say chr(192)+replicate(chr(196),63)+chr(217);nLf++
nrtest++
else
exit
endif
enddo
nLf++
@ nLf,5 say "Número de testemunhas de defesa: "+testdef;nLf++
nLf++
nLf++
nLf++
@ nLf,5 say "Relatório feito por "+quemfez
vezimp++
enddo
eject
set printer to
set devi to scre
use
clear
inkey(15)
@ 5,5 say "Impressão finalizada; grampear as duas vias separadamente."
inkey(10)
return