hola, en una Epson TMU220 usb
//----------------------------
PROCEDURE PRINTWIN()
cDevOut := GetDefaultPrinter()
oPrint := Win32Prn():New(cDevOut)
oPrint:Landscape := .F.
oPrint:FormType := 1
oPrint:Copies := 1
if !oPrint:Create()
Alert("Cannot Create Printer")
BREAK
End if
oPrint:SetFont('Lucida Console',9,{3,-50}, 0, .F., .F.)
oPrint:leftMargin := 05
oPrint:rightMargin:= 200
oPrint:StartDoc()
LIN = 0
NTOT = 0
PAG = 0
DbSelectar("Det_mov")
If DBSeek(cfolio1)
DO WHILE cfolio1=det_mov->folio .and. !Det_mov->(Eof())
TITULOWIN()
LIN=1
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(Transf(det_mov->cant,"99,999.999"), .F. )
oPrint:SetPrc(oPrint:Prow() , 11 )
oPrint:Textout(Transf(det_mov->costo_u,"99,999.999"), .F. )
oPrint:SetPrc(oPrint:Prow() , 25 )
oPrint:Textout(Transf( (det_mov->cant*det_mov->costo_u), "99,999.999"), .F. )
NTOT+= (det_mov->cant*det_mov->costo_u)
DbSelectar("Articulo")
DBSetOrder(1)
nombre:=space(20)
If DBSeek(AllTrim(det_mov->id_produc))
nombre:=articulo->nom
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(Transf(det_mov->cant, "99,999.999"), .F. )
oPrint:SetPrc(oPrint:Prow(), 11 )
oPrint:Textout(Transf(articulo->precio,"99,999.999"), .F. )
oPrint:SetPrc(oPrint:Prow(), 25 )
oPrint:Textout(Transf( (det_mov->cant*articulo->precio),"99,999.999"), .F. )
DBSetOrder(2)
If DBSeek(AllTrim(det_mov->id_produc))
Do while det_mov->id_produc = articulo->liga
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(Transf(det_mov->cant, "99,999.999"), .F. )
oPrint:SetPrc(oPrint:Prow(), 11 )
oPrint:Textout(Transf(articulo->precio, "99,999.999"), .F. )
oPrint:SetPrc(oPrint:Prow(), 25 )
oPrint:Textout(Transf((det_mov->cant*articulo->precio) , "99,999.999"), .F. )
DBSkip()
Enddo
Endif
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(det_mov->id_produc, .F. )
oPrint:SetPrc(oPrint:Prow(), 10 )
oPrint:Textout(substr(nombre,1,35), .F. )
Else
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout("CLAVE NO ENCONTRADA", .F. )
Endif
DbSelectar("Det_mov")
DBSkip()
ENDDO
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(REPLICATE("-",40), .F. )
oPrint:SetPrc(oPrint:Prow()+1, 10 )
oPrint:Textout("TOTAL:", .F. )
oPrint:SetPrc(oPrint:Prow(), 24 )
oPrint:Textout(Transf(NTOT,"999,999.999"), .F. )
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(" ", .F. )
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(ENC_mov->CONCEP1, .F. )
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(ENC_mov->CONCEP2, .F. )
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(ENC_mov->CONCEP3, .F. )
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(" ", .F. )
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout("REALIZO: "+ENC_MOV->USER, .F. )
ELSE
oPrint:SetPrc(oPrint:Prow(1), 1 )
oPrint:Textout("NO ENCONTRE NADA" , .F. )
ENDIF
oPrint:EndDoc(.F.)
oPrint:Destroy()
RETURN
//---------------------
PROCEDURE TITULOWIN()
Dbselectar("Enc_mov")
IF DBSEEK(CFOLIO1)
IF LIN = 0
PAG++
oPrint:SetPrc(0, 0)
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(cNOM_EMP,.F.)
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout(cSUC_EMP,.F.)
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout("REIMPRESION DE MOVIMIENTOS",.F.)
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout("FECHA DE IMP: " + DTOC(DATE()), .F. )
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout("FECHA DEL MOVTO: " + DTOC(ENC_MOV->FECHA) , .F. )
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout("CONCEPTO: " + SUBSTR(ENC_MOV->DE_CONCEP,1,32), .F. )
oPrint:SetPrc(oPrint:Prow()+1, 0 )
oPrint:Textout("FOLIO: " + + CFOLIO1, .F. )
oPrint:SetPrc(oPrint:Prow()+1,0 )
oPrint:Textout(REPLICATE("-",40) , .F.)
oPrint:SetPrc(oPrint:Prow()+1,0 )
oPrint:Textout(" ", .F.)
oPrint:SetPrc(oPrint:Prow()+1,0 )
oPrint:Textout (" CANT PRECIO U. TOTAL" , .F. )
oPrint:SetPrc(oPrint:Prow()+1,0 )
oPrint:Textout (" CLAVE DESCRIPCION" , .F. )
oPrint:SetPrc(oPrint:Prow()+1,0 )
oPrint:Textout(REPLICATE("-",40),.F.)
ENDIF
ENDIF
Return
Saludos!