Todas las impresoras de tickets que manejo con la rutina que te pase, no hacen salto de página al hacer ENDPRINT
Tal vez tendrias que ver las preferencias de impresion y el tamaño de papel que tiene asignado en windows la impresora.
gdeteran wrote:José, tengo la impresión que el salto de línea está expresado en pixceles. Intenta que en vez de ++nRow prueba nRow += 10 por ejemplo.
aDocsVenta // arreglo que viene como parametro y contienes los datos a imprimir
cDocToPrint := './Preview/'+alltrim(cGetNumeroDoc)+'.txt'
if nSalida>1
oPrn:= TDosPrn():New("CUPOM.TXT") // ver la impresion por pantalla
else
oPrn:= TDosPrn():New(cDocToPrint) // para ir directo a la impresora
endif
oPrn:StartPage() // da inicia la pagina.
************************************************************************************
* imprime el encabezado de la factura *
************************************************************************************
nRow := 0
@ nRow, 00 Say chr(18)+_cCompanyName of oPrn ; ++nRow
@ nRow, 00 Say "R.I.F :"+_cCompanyRif of oPrn ; ++nRow
@ nRow, 00 Say CHR(15)+_cDireccion1 of oPrn ; ++nRow
@ nRow, 00 Say _cDireccion2 of oPrn ; ++nRow
@ nRow, 00 Say "Telf."+_cTelefonos of oPrn ; ++nRow
@ nRow, 00 Say alltrim(_cCiudad)+" - "+alltrim(_cEstado) of oPrn ; ++nRow
if !Empty(_cMail)
@ nRow, 00 Say "eMail :"+_cMail of oPrn ; ++nRow
endif
if !Empty(_cWebSite)
@ nRow, 00 Say "WebSite :"+_cWebSite of oPrn ; ++nRow
endif
@ nRow, 00 Say chr(18)+cDoc+alltrim(subs(cGetNumeroDoc,4,10)) of oPrn ; ++nRow
@ nRow, 00 Say "Fecha :"+dtoc(date()) of oPrn ; ++nRow//; //3
@ nRow, 00 Say "Hora :" + subs(TIME(),1,5) of oPrn ; ++nRow//; //4
@ nRow, 00 Say "Venta en :" + alltrim(aDocsVenta[1,34]) of oPrn ; ++nRow//; //4
iif(nCondicion=1,cCondicion:='Contado',cCondicion:='Credito')
@ nRow, 00 Say "Condicion:" + cCondicion of oPrn ; ++nRow//; //4
@ nRow, 00 Say +"|"+REPLICATE("-",27)+"|" of oPrn ; ++nRow
@ nRow, 00 Say CHR(18)+"Cliente:"+chr(15) of oPrn ; ++nRow//; //4
@ nRow, 00 Say cNombreCliente of oPrn ; ++nRow//; //4
@ nRow, 00 Say "CI/RIF :" +cGetRif of oPrn ; ++nRow//; //4
if !Empty(cDireclien1)
@ nRow, 00 Say cDireclien1 of oPrn ; ++nRow//; //4
endif
if !Empty(cDireclien1)
@ nRow, 00 Say cDireclien2 of oPrn ; ++nRow//; //4
endif
if !Empty(cTelfCliente)
@ nRow, 00 Say "telef. :"+cTelfCliente of oPrn ; ++nRow//; //4
endif
@ nRow, 00 Say "|"+REPLICATE("-",47)+"|" of oPrn ; ++nRow
************************************************************************************
* imprime el cuerpo de la factura *
************************************************************************************
nCiclo:=1
Do While nCiclo<=len(aDocsVenta)
cDescripcion := aDocsVenta[nCiclo,1]
cCantidad := aDocsVenta[nCiclo,2]
cPrecioU := aDocsVenta[nCiclo,3]
cSubTotal := aDocsVenta[nCiclo,2]*aDocsVenta[nCiclo,3]
@ nRow, 00 Say cDescripcion of oPrn ; ++nRow // descripcion del articulo
@ nRow, 00 Say "Und " of oPrn
@ nRow, 04 Say cCantidad+ " x "+cPrecioU of oPrn // cantidad vendida
@ nRow, 30 Say cSubTotal of oPrn ; ++nRow // SubTotal
nRow ++
Enddo
nCicloHeader:= 1
cLeyenda1 := (cGetFromIni("LeyendasFact" , "Leyenda_Fact1" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' ))
cLeyenda2 := (cGetFromIni("LeyendasFact" , "Leyenda_Fact2" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' ))
cLeyenda3 := (cGetFromIni("LeyendasFact" , "Leyenda_Fact3" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' ))
cLeyenda4 := (cGetFromIni("LeyendasFact" , "Leyenda_Fact4" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' )) // leyendas genericas que se colocal al final de todas las facturas
cLeyenda5 := (cGetFromIni("LeyendasFact" , "Leyenda_Fact5" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' )) // por ejemplo "esta facura vence a los 30 dias"
cLeyenda6 := (cGetFromIni("LeyendasFact" , "Leyenda_Fact6" , "..." , '\\'+_cHost+'\Neuro32\Ini\exe.ini' )) // "revise la mercancia antes de salir de la tienda. No se hacen devoluciones
************************************************************************************
* se cierra la impresion *
************************************************************************************
@ nRow, 00 Say "|"+REPLICATE("-",47)+"|" of oPrn ; ++nRow
@ nRow, 02 Say "Sub-Total" of oPrn
@ nRow, 30 Say + cSubTotal of oPrn ; ++nRow
@ nRow, 02 Say "Excento" of oPrn
@ nRow, 30 Say + cExcento of oPrn ; ++nRow
@ nRow, 02 Say "Descuentos" of oPrn
@ nRow, 30 Say + cDescuent of oPrn ; ++nRow
@ nRow, 02 Say "Base Imponible" of oPrn
@ nRow, 30 Say + cBase of oPrn ; ++nRow
@ nRow, 02 Say "I.V.A. "+cVarAux of oPrn
@ nRow, 30 Say cIva of oPrn ; ++nRow
@ nRow, 02 Say "Total "+cVarAux2 of oPrn
@ nRow, 30 Say cTotal of oPrn ; ++nRow
@ nRow, 00 Say "|"+REPLICATE("-",47)+"|" of oPrn ; ++nRow
if _lPrintLeyend
@ nRow, 00 Say cLeyenda1 of oPrn ; ++nRow
@ nRow, 00 Say cLeyenda2 of oPrn ; ++nRow
@ nRow, 00 Say cLeyenda3 of oPrn ; ++nRow
@ nRow, 00 Say cLeyenda4 of oPrn ; ++nRow
@ nRow, 00 Say cLeyenda5 of oPrn ; ++nRow
@ nRow, 00 Say cLeyenda6 of oPrn ; ++nRow
endif
nRow:=nRow+14
@ nRow, 00 Say "." of oPrn // salto del papel hasta la linea de corte de la impresora
@ nRow, 00 Say +CHR(18) of oPrn //; ++nRow // Modo Draft
***********************************************************************************
oPrn:EndPage()
oPrn:End()
if nSalida>1
ImpSpool( "CUPOM.TXT",, .T. )
else
WinExec(("LTFViewr5u.exe "+cDocToPrint)) // si se pide salida por pantalla, se hace el preview con esta utilidad de terceros.
endif // es gratuita y se descarga de internet.
RETURN NIL
artu01 wrote:no llames al oPrn:EndPage() al final solo cuando llames al encabezado del reporte
artu01 wrote:no llames al oPrn:EndPage() al final solo cuando llames al encabezado del reporte
//oPrn:StartPage() // si lo comentas
.
.
.
// oPrn:EndPage() //y si lo comentas estas lineas no imprime?
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 77 guests