Encontr茅 el codigo para la clase tprinter.
/ Listar la base de datos del padron de productos
Autor: Econ. Armando Pic贸n S., Lima, Per煤
/
include "fivewin.ch"
include "report.ch"
PROCEDURE listar( oDlg )
LOCAL nReg := 1
LOCAL Fil := 0 // aqui estuvo el error
LOCAL Col := 0
LOCAL nCol := 115 // columnas que tiene el papel
LOCAL nFil := 64 // filas que tiene el papel
LOCAL LstCol := 112 // ultima columna a utilizar
LOCAL LstFil := 59 // ultima fila para datos
LOCAL nFil1 := 0
LOCAL c, f, cMedio
LOCAL oFnt1, oFnt2, oFnt3, oPen1
*
LOCAL nPag := 0
LOCAL oPrn
LOCAL cDate := STR( DAY( DATE() )) + " de " + ;
sp_mes( MONTH( DATE() ) ) + " del " +;
str(Year(DATE()))
LOCAL TITULO:="LISTADO GENERAL DE REPUESTOS"
LOCAL nLongTit, nMedio
//LOCAL aPagos //:= {} // esto tambi茅n fue error, no se utiliza
DBSELECTAREA("STOCK")
nReg := RECNO()
PRINTER oPrn PrEVIEW MODAL
oPrn:setup()
IF EMPTY(oPrn:hDC)
MsgStop("Impresora no lista","ATENTO")
RETURN NIL
ENDIF
-
caracter铆sticas del papel
oPrn:SetPage( 10 ) // Papel A4==>10
oPrn:SetLandScape() // Orientacion echada
-
Factor de resoluci贸n para columnas y filas (para colocar los datos en su lugar)
c:= oPrn:nHorzRes()/nCol
f:= oPrn:nVertRes()/nFil
cMedio := INT(LstCol / 2) + 1
DEFINE FONT oFnt1 NAME "Sans Serif" SIZE 0,-16 OF oPrn
DEFINE FONT oFnt2 NAME "Sans Serif" SIZE 0,-12 OF oPrn
DEFINE FONT oFnt3 NAME "Sans Serif" SIZE 0,-9 OF oPrn
DBGOTOP()
DO WHILE !EOF()
DO CASE
CASE Fil == 0
oPrn:Startpage()
Fil++
Fil++
Fil++
Fil++
nPag := oPrn:nPage
oPrn:Say(Filf, (cMedio - ( LEN(TITULO)/2 ))c, TITULO, oFnt2)
Fil++
Fil++
oPrn:Say(Filf, (cMedio - ( LEN(oApp:membrete)/2 ))c, oApp:membrete, oFnt2)
Fil++
Fil++
* Linea separador de titulo - encabezados
oPrn:Line(Filf,000c, Filf, LstColc)
nFil1 := Fil
Fil++
* cabecera de columnas
oPrn:Say(Filf, 001c, "ANDM" , oFnt3 ) // ANDAMIO
oPrn:Say(Filf, 005c, "CASL" , oFnt3 ) // CASILLA
oPrn:Say(Filf, 011c, "CODIGO" , oFnt3 ) // CODIGO
oPrn:Say(Filf, 024c, "PROC" , oFnt3 ) // PROCEDENCIA
oPrn:Say(Filf, 030c, "NOMBRE" , oFnt3 ) // NOMBRE
oPrn:Say(Filf, 061c, "UNIDAD" , oFnt3 ) // UNIDAD DE MEDIDA
oPrn:Say(Filf, 069c, "PREC.VTA" , oFnt3 ) // PRECIO DE VENTA
oPrn:Say(Filf, 079c, "DSCTO" , oFnt3 ) // DESCUENTO EN VALOR
oPrn:Say(Filf, 089c, "IGV" , oFnt3 ) // IGV DE PRECIO-DCTO
oPrn:Say(Filf, 099c, "PREC.PUBLICO.", oFnt3 ) // PRECIO FACTURADO
Fil++
oPrn:Say(Filf, 069c, " US$ " , oFnt3 ) // PRECIO DE VENTA
oPrn:Say(Filf, 079c, " US$ " , oFnt3 ) // DESCUENTO EN VALOR
oPrn:Say(Filf, 089c, "US$" , oFnt3 ) // IGV DE PRECIO-DCTO
oPrn:Say(Filf, 099c, " US$ ", oFnt3 ) // PRECIO FACTURADO
Fil++
Fil++
* Linea separadora entre encabezados e impresion de datos
oPrn:Line(Filf,000c, Filf, LstColc)
Fil++
CASE Fil > LstFil
Fil++
* Linea de cierre de impresion de datos
oPrn:Line(Filf,000c, Filf, LstColc)
-
Linea verticales de impresion de datos
oPrn:Line(nFil1f,000c, Filf,000c)
oPrn:Line(nFil1f,005c, Filf,005c)
oPrn:Line(nFil1f,009c, Filf,009c)
oPrn:Line(nFil1f,022c, Filf,022c)
oPrn:Line(nFil1f,028c, Filf,028c)
oPrn:Line(nFil1f,059c, Filf,059c)
oPrn:Line(nFil1f,067c, Filf,067c)
oPrn:Line(nFil1f,077c, Filf,077c)
oPrn:Line(nFil1f,087c, Filf,087c)
oPrn:Line(nFil1f,097c, Filf,097c)
oPrn:Line(nFil1f,LstColc, Filf,LstColc)
-
Fin cuadro de impresion de datos
Fil++
oPrn:Say(Filf, 002c, "Pag. No. : ", oFnt3 )
oPrn:Say(Filf, 014c, ALLTRIM(STR(nPag,10,0)), oFnt3 )
Fil++
oPrn:endpage()
Fil := 0
OTHER
oPrn:Say(Filf, 002c, STOCK->ANDAMIO, oFnt3 )
oPrn:Say(Filf, 006c, STOCK->CASILLA, oFnt3 )
oPrn:Say(Filf, 010c, STOCK->CODIGO , oFnt3 )
oPrn:Say(Filf, 023c, STOCK->ORIG , oFnt3 )
oPrn:Say(Filf, 029c, STOCK->NOMBRE , oFnt3 )
oPrn:Say(Filf, 060c, STOCK->UNIDAD , oFnt3 )
oPrn:Say(Filf, 075c, TRANSFORM(STOCK->XPRECIOV,"@ 99,999.999"), oFnt3,,,,1 ) // PRECIO DE VENTA
oPrn:Say(Filf, 085c, TRANSFORM(STOCK->XDCTO ,"@ 99,999.999"), oFnt3,,,,1 ) // DESCUENTO EN VALOR
oPrn:Say(Filf, 095c, TRANSFORM(STOCK->XIGV ,"@ 99,999.999"), oFnt3,,,,1 ) // IGV DE PRECIO-DCTO
oPrn:Say(Filf, 105c, TRANSFORM(STOCK->XPRECIOF,"@ 999,999.99"), oFnt3,,,,1 ) // PRECIO FACTURADO
Fil++
SKIP
ENDCASE
ENDDO
*
Fil++
* Linea de cierre de impresion de datos
oPrn:Line(Filf,000c, Filf, LstColc)
- Linea verticales de impresion de datos
oPrn:Line(nFil1f,000c, Filf,000c)
oPrn:Line(nFil1f,005c, Filf,005c)
oPrn:Line(nFil1f,009c, Filf,009c)
oPrn:Line(nFil1f,022c, Filf,022c)
oPrn:Line(nFil1f,028c, Filf,028c)
oPrn:Line(nFil1f,059c, Filf,059c)
oPrn:Line(nFil1f,067c, Filf,067c)
oPrn:Line(nFil1f,077c, Filf,077c)
oPrn:Line(nFil1f,087c, Filf,087c)
oPrn:Line(nFil1f,097c, Filf,097c)
oPrn:Line(nFil1f,LstColc, Filf,LstColc)
- Fin cuadro de impresion de datos
Fil++
oPrn:Say(Filf, 002c, "Pag. No. : ", oFnt3 )
oPrn:Say(Filf, 014c, ALLTRIM(STR(nPag,10,0)), oFnt3 )
oPrn:endpage()
ENDPRINT
oFnt1:End()
oFnt2:End()
oFnt3:End()
oPrn:SetPortrait() // Orientacion parada
oPrn:End()
DBGOTOP()
DBGOTO( nReg )
RETURN
*
/*
Formulario de la lista Productos
脷脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脗脛驴
鲁ANDM CASL CODIGO PROC NOMBRE UNIDAD PREC.VTA DSCTO IGV PREC.FACT.鲁鲁
脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脕脛脵
12 123 123456789012 12345 123456789012345678901234567890 1234567 12345.789 12345.789 12345.789 123457.89
01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
1 2 3 4 5 6 7 8 9 0 1
Caracteristicas de la base de datos
Cliente----: 12345678901 123456789012345678901234567890123456789012345
Direcci贸n--: 123456789012345678901234567890123456789012345
123456789012345678901234567890123456789012345
123456789012345678901234567890123456789012345
Tel茅fono---: 123456789012
Loc.Entrega: 123456789012345678901234567890123456789012345
Direcci贸n--: 123456789012345678901234567890123456789012345
Tel茅fono---: 123456789012
NOM_CLIENT" ,"C", 45,0},; // nombre del cliente
DIR_CLIENT" ,"C", 45,0},; // direccion1 del cliente
DIR_CLIEN2" ,"C", 45,0},; // direccion2 del cliente
DIR_CLIEN3" ,"C", 45,0},; // direccion3 del cliente
LOC_CLIENT" ,"C", 45,0},; // local de entrega
LOC_DIRCLI" ,"C", 45,0},; // direc. local de entrega
TF1_CLIENT" ,"C", 12,0},; // telefono cliente
TF2_CLIENT" ,"C", 12,0} ; // telefono local de entrega
*/