FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Poner hoja 1 de N en tprinter
Posts: 132
Joined: Sun Oct 23, 2005 04:09 PM
Poner hoja 1 de N en tprinter
Posted: Wed Sep 15, 2010 04: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

Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Poner hoja 1 de N en tprinter
Posted: Wed Sep 15, 2010 05: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 := 70nColStep
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
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Poner hoja 1 de N en tprinter
Posted: Tue Oct 12, 2010 04:34 PM

Una preguntilla. La función numeraPag( .... ) en que parte del código hay que ubicarla ??? Gracias

Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Poner hoja 1 de N en tprinter
Posted: Wed Oct 13, 2010 02: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
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Poner hoja 1 de N en tprinter
Posted: Wed Oct 13, 2010 03:25 PM

Francisco, muchas gracias por la respuesta. Lo probaré.

Continue the discussion