Estou apelando a vocês pois não consegui resolver o problema (Pura ferrugem depois de muito tempo parado).
Pesquisei aqui no fórum e localizei a rotina de impressão abaixo, gerei o relatório em arquivo texto, controlei via programa o EJECT, porem, só imprime 1 pagina.
Poderiam me informar onde estou errando.
FUNCTION SELPRINT(PRELATO)
Local eol := Chr(13) + Chr(10), cCupom, nPrn, aPrn := Win_PrinterList()
#define FORM_A4 9
REQUEST hb_CodePage_PTISO
Set( _SET_CODEPAGE, "PTISO" )
do While nPrn != 0
@ 1, 0 SAY "Selecione a impressora:"
@ 2, 0 TO MaxRow(), MaxCol()
nPrn := AChoice( 3, 1, MaxRow() - 1, MaxCol() - 1, aPrn, .T.,, nPrn )
IF nPrn != 0
PrintWinPrn( PRELATO , aPrn[ nPrn ] )
Endif
EndDo
Clear Screen
eturn Nil
Function PrintWinPrn( cArq, cPrint )
Local oPrn, aPrn := GetPrinters(), n := 0
oPrn := Win_Prn():New(cPrint)
oPrn : LandScape := .F.
oPrn : FormType := FORM_A4
oPrn :Copies := 1
oPrn :CharSet(255)
oPrn:SetFont('courier new',17,{1,17}, 0,.F.,.F.)
If !oPrn:Create()
Alert("Nao foi criado o documento de Impressao")
Return nil
EndIf
If !oPrn:StartDoc("Imprimindo Documento")
Alert("Erro na Impressora")
Return nil
EndIf
HB_CDPSelect("PT850")
SetPrc(0,0)
cText := MemoRead( cArq )
nLinh := MlCount( cText )
For n := 1 to nLinh
*TERM1(N,NLINH,19)
oPrn:TextOut(HB_AnsiToOem(MemoLine(cText,,n)),.t.)
Next
oPrn:EndDoc()
HB_CDPSelect( "PTISO")
Return .t.