Poner hoja 1 de N en tprinter

Poner hoja 1 de N en tprinter

Postby Miguel Salas » Wed Sep 15, 2010 4:09 pm

Exactamente necesito eso , se me ocurre regresar a la pagina 1 del metafile y empezar a escribir el total de hojas, mas no se si sea posible..

saludos
Miguel Salas
 
Posts: 132
Joined: Sun Oct 23, 2005 4:09 pm
Location: Pánuco,Ver. México

Re: Poner hoja 1 de N en tprinter

Postby FranciscoA » Wed Sep 15, 2010 5:04 pm

Prueba esta función que encontré por acá.

//NUMERAR PAGINAS CON TPRINTER
//---------------------------------------------
Function NumeraPag(oPrn,oFont,nRowStep,nColStep)
Local x
Local nPaginas := Len( oPrn:aMeta )
Local aFicheros := oPrn:aMeta
Local nCol := 70*nColStep
Local nLin := 64*nRowStep

if nPaginas <= 1 // Solamente una pagina
Return Nil
endif

oPrn:aMeta := {}

FOR x := 1 TO nPaginas
PAGE
oPrn:ImportWMF( aFicheros[ x ], .F. )
oPrn:Say( nLin,nCol, +Alltrim( Str( x ) ) +"/" + Alltrim( Str( nPaginas ) ) , oFont,,,,PAD_RIGHT )
ENDPAGE
NEXT
Return NIl

Saludos
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2114
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Poner hoja 1 de N en tprinter

Postby horacio » Tue Oct 12, 2010 4:34 pm

Una preguntilla. La función numeraPag( .... ) en que parte del código hay que ubicarla ??? Gracias
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Poner hoja 1 de N en tprinter

Postby FranciscoA » Wed Oct 13, 2010 2:47 am

Horacio:

Ejemplo;
PRINT oPrn NAME "hola" PREVIEW //FROM USER
oPrn:SetPortrait() //vertical
DEFINE FONT oFont1 NAME "Arial" SIZE 0, -08 OF oPrn BOLD
DEFINE FONT oFont2 NAME "Arial" SIZE 0, -10 OF oPrn
nRowStep := oPrn:nVertRes() / 66 // LINEAS
nColStep := oPrn:nHorzRes() / 80 // COLUMNAS

While !eof()
PAGE
nRow:=nRowStep*8
oPrn:Say( nRow, nColCentro, "xxxxx", oFont1,,,,PAD_CENTER )
nRow+= nRowStep*4
oPrn:Say( nRow, nCol2, "wwwwwwwwwwwwwwww",oFont2,,,,PAD_LEFT )
etc,etc,etc
ENDPAGE
(cAlias)->(dbSkip())
Enddo

NumeraPag(oPrn,oFont2,nRowStep,nColStep)

oFont1:End()
oFont2:End()
ENDPRINT

(cAlias)->(dbCloseArea())
return nil

Espero te sea util. Saludos.
PD: puedes buscar en el foro por: Pagina x de xx con clase tprinter
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2114
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Poner hoja 1 de N en tprinter

Postby horacio » Wed Oct 13, 2010 3:25 pm

Francisco, muchas gracias por la respuesta. Lo probaré.
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests