Por favor si alguien me pudiera proporcionar un ejemplo de la clase Tprinter
Gracias
Saludos desde M茅xico
Por favor si alguien me pudiera proporcionar un ejemplo de la clase Tprinter
Gracias
Saludos desde M茅xico
Aqu铆 otro ejemplo: http://www.despachoarteaga.com.mx/imprimir.zip
Maestros
Muchas gracias por sus respuestas, voy a ponerme a trabajar en esto
Saludos
Hola Juan:
Aqui tienes un ejemplo funcional para imprimir con TPrinter:
#Include "FiveWin.CH"
STATIC cFileBMP
/------------------------------------------------------------------------------/
Function ListaPollitos( cModoImp, cDesde, cHasta, cPDF )
/------------------------------------------------------------------------------/
LOCAL oPrn, oFontC, oFontD, oFontT, oPen
LOCAL nRow := 0, nTReg := 0, nConta := 0
DEFAULT cPDF := ""
If cModoImp == "P"
PRINT oPrn NAME "Impresi贸n de Pollitos" PREVIEW
Else
PRINT oPrn NAME "Impresi贸n de Pollitos"
End
If Empty( oPrn:hDC )
Return NIL
End
If !Empty( cPDF )
oPrn:cDocument := AllTrim( cPDF )
End
DEFINE FONT oFontC NAME "Tahoma" SIZE 0, -8 BOLD OF oPrn
DEFINE FONT oFontD NAME "Tahoma" SIZE 0, -7 OF oPrn
DEFINE FONT oFontT NAME "Tahoma" SIZE 0, -7 BOLD OF oPrn
DEFINE PEN oPen WIDTH 5 OF oPrn
PAGE
nRow := 1
nConta := 1
Cabeceras( oPrn, @nRow, oFontD, oFontC, oPen )
While ! CriaMano->( Eof() )
If CriaMano->CodAve >= cDesde .AND. CriaMano->CodAve <= cHasta
Detalle( oPrn, @nRow, oFontD, oPen )
nTReg++
nConta++
End
CriaMano->( DbSkip() )
SysRefresh()
If nConta >= 50 .AND. ! CriaMano->( Eof() )
oPrn:EndPage()
oPrn:StartPage()
nRow := 1
nConta := 0
Cabeceras( oPrn, @nRow, oFontD, oFontT, oPen )
End
End
Totales( oPrn, nRow, oFontT, oPen, nTReg )
ENDPAGE
ENDPRINT
oFontC:End()
oFontD:End()
oFontT:End()
oPen:End()
Return NIL
/------------------------------------------------------------------------------/
STATIC Function Cabeceras( oPrn, nRow, oFontD, oFontC, oPen )
/------------------------------------------------------------------------------/
LOCAL oImageM, oImageH
LOCAL aMacho := Array( 4 )
LOCAL aHembra := Array( 4 )
LOCAL cFileM := ""
LOCAL cFileH := ""
LOCAL nRowImage := 0
/ Impresion de la Cabecera del listado /
oPrn:CmSay( nRow+=1, 3, "Procedimiento: PROC5014.PRG", oFontD )
oPrn:CmSay( nRow, 9, "LISTADO DE POLLITOS", oFontC )
oPrn:CmSay( nRow, 15, "Pagina: " + AllTrim( Str( oPrn:nPage ) ), oFontD )
oPrn:CmSay( nRow, 17, "Fecha: " + dToc( Date() ), oFontD )
oPrn:CmSay( nRow+=0.3, 3, Replicate( "-", 182 ), oFontD )
nRow+=1
oPrn:CmSay( nRow, 3, "C贸digo" , oFontC )
oPrn:CmSay( nRow, 12, "Volumen" , oFontC )
oPrn:CmSay( nRow, 13.7, "Peso" , oFontC )
nRow+=0.3
oPrn:CmSay( nRow, 3, "Ave" , oFontC )
oPrn:CmSay( nRow, 4.5, "Identificaci贸n", oFontC )
oPrn:CmSay( nRow, 9.5, "Estado" , oFontC )
oPrn:CmSay( nRow, 12, "Ingerido" , oFontC )
oPrn:CmSay( nRow, 13.7, "Actual" , oFontC )
oPrn:CmSay( nRow, 15, "Ubicaci贸n" , oFontC )
nRow+=0.5
LinePrint( oPrn, nRow, 3, nRow, 19, oPen )
Return NIL
/------------------------------------------------------------------------------/
STATIC Function Detalle( oPrn, nRow, oFontC, oPen )
/------------------------------------------------------------------------------/
nRow+=0.2
oPrn:CmSay( nRow, 3, CriaMano->CodAve, oFontC )
If MiDosBuscar( "Aves", 1, CriaMano->CodAve )
oPrn:CmSay( nRow, 4.5, Aves->Identi, oFontC )
End
oPrn:CmSay( nRow, 9.5, CriaMano->Estado, oFontC )
oPrn:CmSay( nRow, 11.8, TransForm( CriaMano->VolTot, "999,999.99 ml" ), oFontC )
oPrn:CmSay( nRow, 13.7, TransForm( CriaMano->PesAct, "999.99 gr" ) , oFontC )
If MiDosBuscar( "Ubicacio", 1, CriaMano->CodUbi )
oPrn:CmSay( nRow, 15, Ubicacio->DenUbi, oFontC )
End
nRow+=0.2
Return NIL
/------------------------------------------------------------------------------/
STATIC Function Totales( oPrn, nRow, oFont, oPen, nTReg )
/------------------------------------------------------------------------------/
LinePrint( oPrn, nRow+=0.2, 3, nRow, 19, oPen )
oPrn:CmSay( nRow+=0.2, 3, "Total Registros Seleccionados:", oFont )
oPrn:CmSay( nRow, 7, TransForm( nTReg, "9,999" ), oFont )
Return NIL
Un saludo
JLL
Gracias JLL-FWH
No hab铆a tenido oportunidad de visitar el foro
Saludos
/*------------------------------------------------------------------------------*/
STATIC Function Detalle( oPrn, nRow, oFontC, oPen )
/*------------------------------------------------------------------------------*/
聽 聽 nRow+=0.2
聽 聽 oPrn:CmSay( nRow, 03, emp->id_emp, oFontC )
聽 聽 oPrn:CmSay( nRow, 05, emp->nomemp, oFontC )
聽 聽 oPrn:CmSay( nRow, 13, emp->esdenom, oFontC )
聽 聽 oPrn:CmSay( nRow, 15, TRANSFORM(emp->cuotaapo,"999,999.99"), oFontC )
聽 聽 nRow+=0.2
Return NILHola,
Use el comando CENTER, LEFT 脫 RIGHT.
Amigo prueba asi:
oPrn:CmSay( nRow, 15, TRANSFORM(emp->cuotaapo,"999,999.99"), oFontC,,,,0)
Saludos
#Include "FiveWin.Ch"
#Define PAD_LEFT 聽 聽 聽 聽 聽 聽0
#Define PAD_RIGHT 聽 聽 聽 聽 聽 1
#Define PAD_CENTER 聽 聽 聽 聽 聽2
FUNCTION...
...
RETURN NIL
FUNCTION IMPRIMIR()
聽 聽 聽 聽 nLinha := 0.50
nColuna := 1.00
聽 聽 聽 聽 ResLinha 聽:= oPrn:nLogPixely() / 2.54
聽 聽 聽 聽 ResColuna := oPrn:nLogPixelx() / 2.54
聽 聽 聽 聽 oPrn:Say( nLinha * ResLinha, nColuna * ResColuna, 聽 聽 聽 聽;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "RESUMO GERAL: ", oFont,, 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 聽 聽 聽 聽 CLR_BLACK,, PAD_CENTER )
聽 聽 聽 聽 nLinha ++
聽 聽 聽 聽 oPrn:Say( nLinha * ResLinha, nColuna * ResColuna, 聽 聽 聽;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "EM TICKETS...: " + 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 聽 聽 聽 聽 TRANSF( nTickets, "@E 999,999.99" ), oFont,, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 CLR_BLACK,, PAD_LEFT )
RETURN NILHola amigos :
Quiero expresarles mi agradecimiento por fin estoy elaborando mis reportes con TPrinter
Ya tambi茅n resolv铆 el aspecto del alineado de las columnas
A todos muchas gracias por sus atenciones, es un gesto que me motiva a seguir adelante en esto del FiveWin