PRINTER oPrn FILE cFilePdf
- Code: Select all Expand view RUN
#include "FiveWin.ch"
FUNCTION Main()
// 1 2 3 4 5 6 7 8 9
Local aDatos := {;
{"Juan 1","Pago 1","Juan","Pedro","1000","Algo 1"},;
{"Juan 2","Pago 2","Juan","Pedro","2000","Algo 2"},;
{"Juan 3","Pago 3","Juan","Pedro","3000","Algo 3"},;
{"Juan 4","Pago 4","Juan","Pedro","4000","Algo 4"},;
{"Juan 5","Pago 5","Juan","Pedro","5000","Algo 5"},;
{"Juan 6","Pago 6","Juan","Pedro","6000","Algo 6"},;
{"Juan 7","Pago 7","Juan","Pedro","7000","Algo 7"};
}
ImprimoRecibos(aDatos)
RETURN nil
STATIC FUNCTION ImprimoRecibos( aDatos )
LOCAL oPrn, oFont,n := 0, nRow, i := 1, aSizes
LOCAL cFilePdf := cTempFile( ".\", ".pdf" )
LOCAL cMsg := "Exportando a PDF: Aguarda un momento"
DEFINE FONT oFont NAME "Arial" SIZE 36, 70
//PRINT oPrn DOC "recibos" PREVIEW
PRINTER oPrn FILE cFilePdf // NAME 'SysCtrl CFDI Report'
//aSizes := oPrn:Units2Pix(0,0,7.2,327.0,'CM')
//xbrowse (aSizes)
//oPrn:SetSize( aSizes[3], aSizes[4] )
nRow := 4
PAGE
@ 0,0 PRINT TO oPrn IMAGE "logo.jpg" SIZE oPrn:nHorzRes(), oPrn:nVertRes() PIXEL GRAY
@ nRow , 1 PRINT TO oPrn TEXT aDatos[i,1] SIZE 7,.5 CM FONT oFont LASTROW nRow ALIGN "C"
@ nRow , 1 PRINT TO oPrn TEXT aDatos[i,2] SIZE 7,.5 CM FONT oFont LASTROW nRow ALIGN "C"
@ nRow , 1 PRINT TO oPrn TEXT aDatos[i,3] SIZE 7,.5 CM FONT oFont LASTROW nRow ALIGN "C"
@ nRow , 1 PRINT TO oPrn TEXT aDatos[i,4] SIZE 7,.5 CM FONT oFont LASTROW nRow ALIGN "C"
@ nRow , 1 PRINT TO oPrn TEXT aDatos[i,5] SIZE 7,.5 CM FONT oFont LASTROW nRow ALIGN "C"
@ nRow , 1 PRINT TO oPrn TEXT aDatos[i,6] SIZE 7,.5 CM FONT oFont LASTROW nRow ALIGN "C"
@ nRow , 1 PRINT TO oPrn IMAGE "..\bitmaps\olga1.jpg" SIZE 4, 4 CM LASTROW nRow
ENDPAGE
ENDPRINT
MSGRUN( cMsg, "Usuario", {|| Shellexecute( 0,"open", cFilePdf ) } )
RETURN nil