REPORT

Post Reply
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

REPORT

Post by Manuel Valdenebro »

Probando los ejemplos de Samples\report compruebo que antes de salir el preview, sale una ventana (FiveWin Report/Building Page xx). Eso no ocurre en mis aplicaciones.

A veces es conveniente que salga esta ventana, porque cuando tiene que preparar muchas páginas el programa se queda "esperando".

¿Que tengo que hacer para que me salga esta ventana de Building Page?.
Last edited by Manuel Valdenebro on Fri Apr 14, 2006 6:58 pm, edited 1 time in total.
Un saludo

Manuel
User avatar
Antonio Linares
Site Admin
Posts: 42820
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 124 times
Been thanked: 117 times
Contact:

Post by Antonio Linares »

Manuel,

Si pruebas el siguiente ejemplo (desde el directorio samples):

Code: Select all | Expand

#include "FiveWin.ch"function Main()   USE Customer   Browse()   USE   return nil   

y pulsas el botón "print", verás que se construye un reporte y sale la caja de diálogo que comentas.

No tendrás modificado prev32.dll y tal vez no esté esa caja de diálogo disponible ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

Antonio,

La "cosa" ocurre cuando la página tiene alguna imagen. Me imagino que habrá algun conflicto entre freeimage.dll y preview.dll. Cuando es un listado sin imagenes no hay problemas.
Un saludo

Manuel
User avatar
Antonio Linares
Site Admin
Posts: 42820
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 124 times
Been thanked: 117 times
Contact:

Post by Antonio Linares »

Manuel,

Cuantas páginas tiene el listado ? En principio no tiene porque haber ningún conflicto entre esas DLLs.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

Antonio,

Tiene 28 páginas (pero pueden ser muchas mas). Se trata de listar las facturas entre dos fechas. Cada factura tiene su correspondiente imagen. Tarda un minuto en cargar (el disco duro tirita) y luego sale el preview sin salir la ventanita de "building page".
Un saludo

Manuel
User avatar
Antonio Linares
Site Admin
Posts: 42820
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 124 times
Been thanked: 117 times
Contact:

Post by Antonio Linares »

Manuel,

En el build de Abril hemos usado la función cTempFile() para asignarle los nombres a los ficheros temporales usados por los metafiles para el preview, pero esta función cTemFile() consume mucho tiempo por su diseño. Hay que cambiarla de esta forma en source\function\filename.prg:

Code: Select all | Expand

function cTempFile( cPath, cExtension )        // returns a temporary filename   local cFileName   static cOldName   DEFAULT cPath := "", cExtension := ""      if ! "." $ cExtension      cExtension = "." + cExtension   endif      while File( cFileName := ( cPath + LTrim( Str( GetTickCount() ) ) + cExtension ) ) .or. ;      cFileName == cOldName   end   cOldName = cFileNamereturn cFileName

Por favor cámbiala y eso debería reducir mucho el tiempo de generación del preview. Veamos si eso afecta tambien a la ventana que muestra como se crean las páginas.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

Antonio, estamos en las mismas.

De momento, he puesto en la función cTempFile un msgwait para darle vidilla. Pero sigue tardando demasiado y la ventana del 'building page' sigue 'missing'.
Un saludo

Manuel
User avatar
Antonio Linares
Site Admin
Posts: 42820
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 124 times
Been thanked: 117 times
Contact:

Post by Antonio Linares »

Manuel,

Puedes proporcionar un ejemplo pequeño y autocontenido que lo reproduzca ? gracias
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

Antonio, te acompaño un pequeño ejemplo (te lo envio por email para que lo compruebes):

///////////////////////////////////////////////////////////////////////////////

#include "FiveWin.ch"
#include "Image.ch"

function Main()
LOCAL oDlg, oImage

DEFINE DIALOG oDlg FROM 0, 0 TO 10, 50 ;
TITLE "IMPRESION LENTA Y SIN BUILDING PAGES"

@ 0, 0 IMAGE oImage SIZE 0, 0 OF oDlg
oImage:Progress( .f. )
@ 2, 12 BUTTON "Imprimir" SIZE 50,10 OF oDlg ;
ACTION PrintImage( oImage )
ACTIVATE DIALOG oDlg CENTER
oDlg:End()
return nil

static func PrintImage( oImage )

local oPrn, nVeces

oImage:LoadBmp("eva.jpg")
PRINT oPrn NAME "Image Printing" PREVIEW
FOR nVeces = 0 TO 10
PAGE
oPrn:SayImage( 0, 0, oImage, 2000, 3000 )
ENDPAGE
NEXT
ENDPRINT
return nil
Un saludo

Manuel
User avatar
Antonio Linares
Site Admin
Posts: 42820
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 124 times
Been thanked: 117 times
Contact:

Post by Antonio Linares »

Manuel,

La caja de diálogo de "building page..." es sólo usada en la Clase TReport, no en una impresión normal. Podríamos ver la forma de que la clase TPrinter también la usase, de forma parametrizable.

En cuanto a la velocidad, si has modificado cTempFile() como te hemos indicado, es totalmente correcta. Aqui hemos modificado el ejemplo para crear 100 hojas y las crea muy rápido.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42820
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 124 times
Been thanked: 117 times
Contact:

Post by Antonio Linares »

Manuel,

Aqui tienes tu ejemplo modificado para que muestre la hoja que va creando:

Code: Select all | Expand

static func PrintImage( oImage )   local oPrn, nVeces, oDlg, oSay   DEFINE DIALOG oDlg TITLE "Generando la impresión" SIZE 200, 100      @ 1, 1 SAY oSay PROMPT "Página número 0"      ACTIVATE DIALOG oDlg NOWAIT CENTER   oImage:LoadBmp("eva.jpg")   PRINT oPrn NAME "Image Printing" PREVIEW      FOR nVeces = 0 TO 100         oSay:SetText( "Página número " + AllTrim( Str( nVeces + 1 ) ) )      PAGE         oPrn:SayImage( 0, 0, oImage, 2000, 3000 )      ENDPAGE      NEXT      oDlg:End()   ENDPRINTreturn nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42820
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 124 times
Been thanked: 117 times
Contact:

Post by Antonio Linares »

Manuel,

Y aqui tienes un video para que veas a la velocidad a la que se generan las 100 páginas:

http://hyperupload.com/download/02b3a94 ... n.zip.html
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

Antonio,

Ahora si funciona correctamente. El problema estaba en cTempFile.

Muchas gracias por todo.
Un saludo

Manuel
Post Reply