Problemas al Imprimir un listado de varias paginas

Problemas al Imprimir un listado de varias paginas

Postby darteagal » Wed Apr 11, 2007 12:21 pm

Amigos, estoy generando un listado , pero solo me imprime la primera
pagina ò si tengo un listado largo me esta dejando de imprimir la paginas pares, adjunto parte del programa de impresion, a ver si me pueden
dar alguna idea de que estoy haciendo mal.
Gracias por su apoyo.
Daniel.
FW25 + Clip53 + Blinker6.0


nFila := 1

//------------ Carga Datos del Detalle ----------------------//
PRINT oPrn PREVIEW
IF Empty( oPrn:hDC )
MsgStop( "Printer not ready!" )
Return Nil
END IF

DEFINE FONT oFnt12C NAME "Courier" SIZE 0,-12 OF
oPrn
DEFINE FONT oFnt12CB NAME "Courier" SIZE 0,-12 BOLD OF
oPrn
DEFINE FONT oFnt10C NAME "Courier" SIZE 0,-10 OF
oPrn
DEFINE FONT oFnt08C NAME "Courier" SIZE 0,-8 OF
oPrn
DEFINE FONT oFnt10CB NAME "Courier" SIZE 0,-10 BOLD OF
oPrn
DEFINE FONT oFnt8 NAME "Arial" SIZE 0,-8 ITALIC OF oPrn
DEFINE FONT oFnt10 NAME "Arial" SIZE 0,-10 OF oPrn
DEFINE FONT oFnt10B NAME "Arial" SIZE 0,-10 BOLD OF oPrn
DEFINE FONT oFnt12 NAME "Arial" SIZE 0,-12 BOLD OF oPrn
DEFINE FONT oFnt14 NAME "Arial" SIZE 0,-14 BOLD OF oPrn
DEFINE FONT oFnt16 NAME "Arial" SIZE 0,-16 BOLD OF oPrn

DEFINE BRUSH oBrush COLOR 14671839 // gris claritillo
DEFINE PEN oPen1 WIDTH 5

nRowStep = oPrn:nVertRes() / 20 // We want 20 rows
nColStep = oPrn:nHorzRes() / 15 // We want 15 cols

//oPrn:SetPortrait()
//oPrn:SetLandscape()

PAGE
PintaCabecera( cTipo, oPrn )
nLineas := 0
If (cAlias)->( DbSeek( cTipo + cEstado ) )
WHILE !(cAlias)->( Eof() ) .and. (cAlias)->TIPO =
cTIPO
cCliente := (cAlias)->CodClient
oPrn:cmSay( nFila, 1.0, 'CLIENTE : ' + cCliente
+ ' ' + (cAlias)->Cliente , oFnt10CB )
nFila := nFila + 0.5
Store 0 to nParcialN, nParcialA, nParcialS
nLineas ++
WHILE !(cAlias)->( Eof() ) .and. (cAlias)-
>CODCLIENT = cCliente .and. (cAlias)->TIPO = cTIPO
If nLineas >= 100
oPrn:StartPage()
nFila := 1
PintaCabecera( cTipo, oPrn )
nLineas := 0
Endif

cNomMda := SearchMaestros("06",(cAlias)-
>Moneda, 4)

nParcialN := nParcialN + (cAlias)->Neto
nParcialA := nParcialA + (cAlias)->Abonos
nParcialS := nParcialS + (cAlias)->Saldo

oPrn:cmSay( nFila, 1.0, Dtoc((cAlias)-
>Fecha) , oFnt10C )
oPrn:cmSay( nFila, 3.2, (cAlias)-
>TIPO , oFnt10C )
oPrn:cmSay( nFila, 3.6, Left( (cAlias)-
>NRODOC,5) , oFnt10C )
oPrn:cmSay( nFila, 4.8, (cAlias)-
>Placa , oFnt10C )
oPrn:cmSay( nFila, 6.4,
cNomMda , oFnt10C )
oPrn:cmSay( nFila,07.1, Num2Str( (cAlias)-
>Neto ,09,2 ) , oFnt10C,,,1 )
oPrn:cmSay( nFila,09.2, Num2Str( (cAlias)-
>Abonos,09,2 ) , oFnt10C,,,1 )
oPrn:cmSay( nFila,11.4, Num2Str( (cAlias)-
>Saldo ,09,2 ) , oFnt10C,,,1 )
oPrn:cmSay( nFila,13.4, Left((cAlias)-
>Observ,43 ) , oFnt08C )
(cAlias)->( DbSkip() )
nFila := nFila + 0.5
nLineas ++
If nLineas >= 46
If (cAlias)->( Eof() )

Else
oPrn:cmSay(nFila,17.5,'-----------//-------
----', oFnt10 )
Endif
oPrn:EndPage()
nLineas := 100
End if

END WHILE

oPrn:cmSay( nFila, 1.0, 'Totales Parciales' ,
oFnt10CB,,,1)
oPrn:cmSay( nFila,07.1, Num2Str( nParcialN,
09,2 ) , oFnt10CB,,,1 )
oPrn:cmSay( nFila,09.2, Num2Str( nParcialA,
09,2 ) , oFnt10CB,,,1 )
oPrn:cmSay( nFila,11.4, Num2Str( nParcialS,
09,2 ) , oFnt10CB,,,1 )
nLineas ++
nFila := nFila + 1
nTotalN := nTotalN + nParcialN
nTotalA := nTotalA + nParcialA
nTotalS := nTotalS + nParcialS
END WHILE
oPrn:cmSay( nFila, 1.0, 'Total General' , oFnt10CB,,,1)
oPrn:cmSay( nFila,07.1, Num2Str( nTotalN, 09,2 ) ,
oFnt10CB,,,1 )
oPrn:cmSay( nFila,09.2, Num2Str( nTotalA, 09,2 ) ,
oFnt10CB,,,1 )
oPrn:cmSay( nFila,11.4, Num2Str( nTotalS, 09,2 ) ,
oFnt10CB,,,1 )
ELSE
MsgAlert( 'Informacion solicitada, no Encontrada')
END IF
ENDPAGE
ENDPRINT

SET(_SET_SOFTSEEK, lSS)

oFnt8:End()
oFnt10:End()
oFnt10B:End()
oFnt12:End()
oFnt14:End()
oFnt16:End()

(cAlias )->( DbCloseArea() )
Select( OldSele )
RETURN ( .T. )



// -------------------------------------------------------------------
-----
// Funci¢n ...: PintaCabecera
// Descripci¢n: Pinta Cabecera de la Proforma
// Parametros : aDatos -> Arreglo con Datos de Clientes
// aDatos1 -> Arreglo con Datos del Auto
// oDbfCab -> Cabecera
// oPrn -> Objeto Printer.
// Devuelve ..: Nada.
// -------------------------------------------------------------------
-----
Static Function PintaCabecera( cTipo, oPrn )
oPrn:cmSay( nFila ,5.5, "LISTADO DE DEUDAS POR COBRAR " ,
oFnt14 )
oPrn:cmSay( nFila+0.5,5.5, " AL : " + Dtoc(Date() ), oFnt14 )

nFila := nFila + 2
SubTitulo( oPrn )

Return Nil

Static Function SubTitulo( oPrn )
//-------------------------------
oPrn:cmSay( nFila,01.0, "FECHA" , oFnt10CB )
oPrn:cmSay( nFila,02.8, "NRODOC" , oFnt10CB )
oPrn:cmSay( nFila,04.8, "PLACA" , oFnt10CB )
oPrn:cmSay( nFila,06.4, "MDA" , oFnt10CB )
oPrn:cmSay( nFila,07.1, " NETO " , oFnt10CB )
oPrn:cmSay( nFila,09.2, " ABONOS " , oFnt10CB )
oPrn:cmSay( nFila,11.4, " SALDO " , oFnt10CB )
oPrn:cmSay( nFila,13.4, "OBSERVACIONES" , oFnt10CB )
nFila := nFila + 0.5
Linea(nFila, 01.0,nFila,20.0,oPrn,oPen1)
nFila := nFila + 0.5
Return Nil
darteagal
 
Posts: 12
Joined: Thu Jan 05, 2006 8:57 pm

Postby sjingo » Thu Apr 12, 2007 1:46 am

Hola Daniel

Para cada página debe haber un:

PAGE
...
ENDPAGE

Es decir que tienes que controlar el número de líneas que se imprime por página. Al cumplirse el número de líneas deberías hacer un ENDPAGE, y para hacer una nueva página hacer el PAGE.

Espero me comprendas, suerte.

Marcelo Jingo
User avatar
sjingo
 
Posts: 229
Joined: Sat Mar 18, 2006 3:42 pm
Location: Ibarra-Ecuador

Postby darteagal » Thu Apr 12, 2007 7:38 pm

Gracias por contestar, yo estoy usando si te fijas :
Para finalizar : oPrn:EndPage()
Para comenzar : oPrn:StartPage()

pero parece que startpage no funciona, voy a usar lo que me recomiendas.
Saludos.
daniel.
darteagal
 
Posts: 12
Joined: Thu Jan 05, 2006 8:57 pm

Postby sjingo » Sat Apr 14, 2007 12:25 am

Entonces, te falta poner el oPrn:EndPage() despues de comprobar el numero de líneas:

If nLineas >= 100
oPrn:EndPage()
oPrn:StartPage()
nFila := 1
.......

Un saludo

Marcelo Jingo
User avatar
sjingo
 
Posts: 229
Joined: Sat Mar 18, 2006 3:42 pm
Location: Ibarra-Ecuador


Return to FiveWin para CA-Clipper

Who is online

Users browsing this forum: No registered users and 23 guests