FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index EasyReport, EasyDialog y EasyPreview empezando con easyPreview
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
empezando con easyPreview
Posted: Sat Aug 23, 2014 03:45 PM
El siguiente paso es enlazar el easypreview ...
Me pide un archivo que se llama wpdf.h que no viene en el c贸digo

He retocado algunos errores :

En Epmeta.prg he retocado el codigo de estas funciones para quitar los errores .

Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <windows.h>
#include "hbapi.h"

HB_FUNC(EP_PLAYENHMETAFILE)

{
 RECT rect;
 HENHMETAFILE  hemf =(HENHMETAFILE) hb_parnl( 2 );
 HDC           hDC  = ( HDC ) hb_parnl( 1 );

// GetEnhMetaFileHeader( hemf, sizeof( mh ), &mh ) ;

   if( hb_parl( 4 ) )
   {
      rect.left = 0;
      rect.top  = 0;
      rect.right  = GetDeviceCaps( ( HDC ) hb_parnl( 1 ), HORZRES );
      rect.bottom = GetDeviceCaps( ( HDC ) hb_parnl( 1 ), VERTRES );
   }
   else
   if (HB_IS_ARRAY(3))
     {
       rect.left   = hb_parvni( 3, 1 );
       rect.top    = hb_parvni( 3, 2 );
       rect.right  = hb_parvni( 3, 3 );
       rect.bottom = hb_parvni( 3, 4 );
     }
   else
 //     GetClientRect( WindowFromDC( hDC ), &rc );
      GetClientRect ( (HWND)hb_parnl( 3 ), &rect );
 hb_retl( PlayEnhMetaFile( hDC, hemf, ( LPRECT ) &rect ) );
}
//------------------  ------------------------//
HB_FUNC(ENHMETASIZE)
{
   HENHMETAFILE hemf = (HENHMETAFILE) hb_parnl( 1 );
   INT  sizetyp      =  hb_parni( 2 );
   ENHMETAHEADER mh ;
   RECTL rect ;

   GetEnhMetaFileHeader( hemf, sizeof( mh ), &mh ) ;

   if (sizetyp == 1 )     // Size in Pixel
      rect = mh.rclBounds ;
   else
      rect = mh.rclFrame ;  //Size in 0.1 mm

   hb_reta( 4 );
   hb_storvni(rect.left  , -1, 1 );
   hb_storvni(rect.top   , -1, 2 );
   hb_storvni(rect.right , -1, 3 );
   hb_storvni(rect.bottom, -1, 4 );
}
//------------------  ------------------------//
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: empezando con easyPreview
Posted: Sat Aug 23, 2014 07:44 PM

He subido al repositorio de easypreview un archivo wpdf.h por si alguien lo quiere , supongo que es el que necesitamos .
Ahora me lanza 12 errores al compilar wpdf.c ...
Saludos a todos.

Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: empezando con easyPreview
Posted: Sat Aug 23, 2014 08:50 PM

Manuel,

Ese c贸digo no es necesario y es del m贸dulo nativo de EasyPreview para exportar en PDF.

Edita epreview.prg y cambia el nombre de la funci贸n rpreview a otro. Entonces la funci贸n de preview del dise帽ador usara el de Fivewin. Prueba.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: empezando con easyPreview
Posted: Sun Aug 24, 2014 07:28 AM
lucasdebeltran wrote:Manuel,

Ese c贸digo no es necesario y es del m贸dulo nativo de EasyPreview para exportar en PDF.

Edita epreview.prg y cambia el nombre de la funci贸n rpreview a otro. Entonces la funci贸n de preview del dise帽ador usara el de Fivewin. Prueba.

Pues no resuelve el tema :-) .
Al dar a imprimir en easyreport tenemos 2 opciones o llamar a otro exe llamado "ERSTART.EXE" y ejecutarlo ( el cual tambi茅n tendremos que reconstruir ) o usar la clase epreview ( epclass.prg ) si enlazo este prg es cuando empieza a encadenar llamadas a tpdf , a mypdf , etc ... solo con el cambio de rpreview no resolvemos .
Gracias por la ayuda .... seguiremos investigando .
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: empezando con easyPreview
Posted: Sun Aug 24, 2014 10:15 AM
A ver si ayuda, independientemente de lo que comenta Lucas
Code (fw): Select all Collapse
#define IPT_SELECT 聽 聽 聽 聽0x000 // 
#define IPT_WMF 聽 聽 聽 聽 聽 0x001 // Windows-Metafile
#define IPT_DXF 聽 聽 聽 聽 聽 0x002 // AUTOCAD DXF-
#define IPT_EPS 聽 聽 聽 聽 聽 0x004 // Encapsulated PostScript EPS
#define IPT_BMP 聽 聽 聽 聽 聽 0x008 // Windows-Bitmapfile
#define IPT_TIF 聽 聽 聽 聽 聽 0x010 // TIFF 5.0
#define IPT_GIF 聽 聽 聽 聽 聽 0x020 // Compuserve GIF
#define IPT_PCX 聽 聽 聽 聽 聽 0x040 // PCX
#define IPT_JPG 聽 聽 聽 聽 聽 0x080 // JPEG-File
#define IPT_PNG 聽 聽 聽 聽 聽 0x100 // PNG (Portable network Graphic)
#define IPT_EMF 聽 聽 聽 聽 聽 0x200 // EMF (Enhanced Windows MetaFile)
#define IPT_JPC 聽 聽 聽 聽 聽0x1000 // JPEG-2000 Code Stream Syntax (ISO/IEC 15444-1)
#define IPT_JP2 聽 聽 聽 聽 聽0x2000 // JPEG-2000 JP2 File Format Syntax (ISO/IEC 15444-1)
#define IPT_PGX 聽 聽 聽 聽 聽0x4000 // JPEG-2000 VM Format
#define IPT_RAS 聽 聽 聽 聽 聽0x8000 // Sun Rasterfile (RAS)
#define IPT_PNM 聽 聽 聽 聽 0x10000 // Portable Anymap (Graymap/Pixmap/Bitmap) (PNM, PGM, PPM)

#define IPT_FLT 聽 聽 聽 聽 聽 0x800 // 

#define IPE_OK 聽 聽 聽 聽 聽 聽 0 聽 聽// 

#define IPE_ABORT 聽 聽 聽 聽 聽1 聽 聽// 
#define IPE_WRONGTYPE 聽 聽 聽2 聽 聽// 
#define IPE_CORRUPTED 聽 聽 聽3 聽 聽// 

#define IPE_CLOSE 聽 聽 聽 聽 聽4 聽 聽// 
#define IPE_OPEN 聽 聽 聽 聽 聽 5 聽 聽// 
#define IPE_WRITE 聽 聽 聽 聽 聽6 聽 聽// 
#define IPE_EOF 聽 聽 聽 聽 聽 聽7 聽 聽// 
#define IPE_NOMEM 聽 聽 聽 聽 聽8 聽 聽// 
#define IPE_UNSUPPORTED 聽 聽9 聽 聽// 

#define IPE_MAX256 聽 聽 聽 聽10 聽 聽// 
#define IPE_REENTERED 聽 聽 11 聽 聽//

#define IPE_PARAM 聽 聽 聽 聽 12 聽 聽// 
#define IPE_ERRINFLT 聽 聽 聽13 聽 聽//
#define IPE_ERRNOFLT 聽 聽 聽14 聽 聽// 
#define IPE_ERRTEXTFLT 聽 聽15 聽 聽//
#define IPE_NOLICENSE 聽 聽 16 聽 聽// 

#define IPE_LAST 聽 聽 聽 聽 聽32 聽 聽// 

#define IPF_MSGBOX 聽 聽 聽 聽 聽 聽 聽 聽 聽 0x1L // 
#define IPF_DIB 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽0x8L // 
#define IPF_META 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽0x10L // 
#define IPF_ENH 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽0x800L // 
#define IPF_COMPRESS 聽 聽 聽 聽 聽 聽 聽 聽 0x2L // 

#define IPF_TIFF_APPEND 聽 聽 聽 聽 0x200000L // TIFF-Write: Append Page to existing TIF file.

#define IPF_TIFF_COMPMETHOD 聽 聽 0x300000e0 // TIFF-Write Compression Modes
#define IPF_TIFF_NOCOMP 聽 聽 聽 聽 0x00000020 // TIFF-Write: Uncompressed
#define IPF_TIFF_LZW 聽 聽 聽 聽 聽 聽0x00000040 // TIFF-Write: LZW
#define IPF_TIFF_CCITTRLE 聽 聽 聽 0x00000060 // TIFF-Write: CCITT 
#define IPF_TIFF_CCITTFAX3 聽 聽 聽0x00000080 // TIFF-Write: CCITT G3 Fax Compression
#define IPF_TIFF_CCITTFAX4 聽 聽 聽0x000000a0 // TIFF-Write: CCITT G4 Fax Compression
#define IPF_TIFF_PACKBITS 聽 聽 聽 0x000000c0 // TIFF-Write: PACKBITS
#define IPF_TIFF_JPEG 聽 聽 聽 聽 聽 0x000000e0 // TIFF-Write: JPEG
#define IPF_TIFF_DEFLATE 聽 聽 聽 聽0x10000000 // TIFF-Write: Deflate (zlib)

#define IPF_QUALITY 聽 聽 聽 聽 聽 聽 聽 0xF000L // JPEG- 0x1000: 0x9000 
#define IPF_LOWQUALITY 聽 聽 聽 聽 聽 聽0x3000L // JPEG
#define IPF_INTERLACED 聽 聽 聽 聽 聽 0x10000L // PNG/GIF-Write: Write in interlaced Mode
#define IPF_PNG_INTERLACED 聽 聽 聽 IPF_INTERLACED // Obsolete

#define IPF_FILEDIALOG 聽 聽 聽 聽 聽 聽 聽 0x4L // 

#define IPF_NOPROGRESSBAR 聽 聽 聽 聽 聽0x100L // 
#define IPF_NOWAIT 聽 聽 聽 聽 聽 聽 聽 聽 IPF_NOPROGRESSBAR // 
#define IPF_NOWARNINGS 聽 聽 聽 聽 聽 聽 0x200L // 
#define IPF_ALLOWLZW 聽 聽 聽 聽 聽 聽 聽 0x400L // 

#define IPF_ZLIB_MASK 聽 聽 聽 聽 聽 聽 聽0xc0000000
#define IPF_ZLIB_DEFAULT_COMPRESSION 0x00000000 聽// Medium Speed, Medium compression rate for Deflate-Algorithm
#define IPF_ZLIB_BEST_SPEED 聽 聽 聽 聽0x40000000 聽// High Speed, Low compression rate for Deflate-Algorithm
#define IPF_ZLIB_BEST_COMPRESSION 聽0xc0000000 聽// Low Speed, High compression rate for Deflate-Algorithm


#define IPF_UNUSED 聽 聽 聽 聽 聽 聽 聽 聽 0x0fde0000 聽// IPF_xxxx Bits, 

//------------------- Flags for DXF-Import -----------------------
#define IPDXF_BLACKONLY 聽 聽 聽 聽 聽 聽0x00000001L // Import all DXF-Elements as black
#define IPDXF_IGNOREEXTMINMAX 聽 聽 聽0x00000002L // 
#define IPDXF_EXTENDED 聽 聽 聽 聽 聽 聽 0x00000004L // 

//------------------- Flags for Import DIB-Type selection --------
# 聽define IPDIBF_IMPORT_32BIT 聽 聽 聽 0x00020000L// 
# 聽define IPDIBF_ALLOW_IMPORT_CMYK 聽0x00080000L//
# 聽define IPDIBF_ALLOW_IMPORT_48BIT 0x00100000L// 
# 聽define IPDIBF_ALLOW_IMPORT_RGBA 聽0x00400000L// 
#define IPDIBF_NORMALIZE 聽 聽 聽 聽 聽 聽0x00800000L// 

#define IPM_WARNING 1
#define IPM_ERROR 聽 2

Este es el fichero que he construido
https://navarro_cristobal@bitbucket.org ... iew_n1.git (en descargas)

A partir de lo que he encontrado en:
http://www.herdsoft.com/ftp/downloads.html#davinci
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: empezando con easyPreview
Posted: Sun Aug 24, 2014 06:36 PM
Manuel,

Acabo de actualizar del repositorio y sin hacer nada me sale correctamente el Print/Preview:


Y he visto que en source\easyprev.prg rpreview() est谩 comentada a ER_Preview().

Lo que si salen diversos warnings al compilar.


Es m谩s, si suprimes del make EasyReport #easyprev.prg.

Y de source\ereport.prg y source\erstart.prg est谩s llamadas:

Code (fw): Select all Collapse
   
//EP_TidyUp()
   //EP_LinkedToApp()
   //EP_SetPath( ".\" )



Todo funciona sin problemas.


La clase de impresi贸n de los Reportes es Vrd; source\vrd.prg y el comando es:

EASYREPORT <oVRD> ;
NAME <cRptFile> ;
[ PREVIEW <lPreview> ] ;
[ TO <cPrinter> ] ;
[ OF <oWnd> ] ;
[ <lModal: MODAL> ] ;
[ <lPrintIDs: PRINTIDS> ] ;
[ <lNoPrint: NOPRINT> ] ;
[ <lNoExpr: NOEXPR> ] ;
[ CHECK <lCheck> ] ;
[ AREAPATH <cAreaPath> ] ;
[ PRINTDIALOG <lPrDialog> ] ;
[ COPIES <nCopies> ] ;
[ PRINTOBJECT <oPrn> ] ;
[ PAPERSIZE <aSize> ] ;
[ TITLE <cTitle> ] ;
[ PREVIEWDIR <cPrevDir> ] ;
[ AUTOPAGEBREAK <lAutoBreak> ] ;
[ SHOWINFO <lShowInfo> ] ;

Por defecto, usa el preview de Fivewin.


Respecto a EasyPreview, actualmente el Preview de Fivewin hace lo mismo y m谩s cosas. El c贸digo fuente de Timm podr铆a ser interesante por si las correcciones a la generaci贸n de los MetaFiles son interesantes y, sobre todo, porque generaba PDFS de forma nativa. Como yo no se C no puedo valorar la calidad de tal c贸digo.

Ah, y muchas gracias por el esfuerzo que est谩is haciendo.
Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: empezando con easyPreview
Posted: Sun Aug 24, 2014 08:28 PM
lucasdebeltran wrote:Manuel,
Acabo de actualizar del repositorio y sin hacer nada me sale correctamente el Print/Preview:

Efectivamente son los 煤ltimos cambios que se han hecho para que funcione "de urgencia" , y se pueda utilizar e ir reportando errores . Aun faltan muchas cosas que se han comentado y mucho c贸digo que se esta enlazando que sobra , tambi茅n c贸digo que mirar por si es interesante para mejorar el producto , pero ya parece que funciona, eso si, no totalmente estable .
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: empezando con easyPreview
Posted: Sun Aug 24, 2014 09:55 PM

Manuel,

Sencillamente espectacular :-) Mi mas sincera enhorabuena!

Esta ma帽ana pude dedicarle un rato, luego ya tuve que marcharme para hacer cosas, la familia, etc. y cuando he regresado ahora y lo he visto, me he quedado realmente asombrado!

Ahora falta entender como lo has hecho. Si nos explicases un poco cual ha sido la estrategia para incluirlo y hacerlo funcionar, seguro que muchos te lo agradecer铆amos :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: empezando con easyPreview
Posted: Mon Aug 25, 2014 06:09 AM

Realmente no he tenido que modificar demasiadas cosas , he renombrado la funci贸n de Tim Rpreview a ER_rpreview() ( nos sobra realmente ) , he enlazado los m贸dulos necesarios y comentado las funciones que daban error para mas adelante revisarlas , ahora mismo sobra mucho c贸digo que se ha enlazado y alguno falla , he pasado dialogos no modales a modales de momento ( se ve que en el desarrollo inicial estaban en modal y quedaron a medias en el desarrollo de Tim ) .
Falta algo de trabajo y el programa a煤n rompe en ocasiones , pero amenos se puede usar .
Saludos a todos.

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: empezando con easyPreview
Posted: Tue Aug 26, 2014 09:30 PM

Si os hab茅is fijado, una vez lanzado el preview de un report, se puede volver a pulsar el boton "Imprimir" por lo que te crea otra ventana (por el tema de ser MdiChild) con otra previsualizacion del mismo reporte
Una vez lanzado la previsualizacion del report habria que desactivar el boton imprimir y preview

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces

Continue the discussion