ExecuteReport( )
Moderator: Rathinagiri
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: ExecuteReport( )
Obrigado Daniel, vou esperar um pouco o do FW e ver a viabilidade. Meus conhecimentos em C são limitados.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
PRINT TO PDF
Hola
Me pasa algo extraño con este ejemplo...
Solo funciona con la imagen que trae la carpeta: D:\HMG\3.4\SAMPLES\HPDF\HMG_HPDF\hmghpdf.png
Puede alguien probarlo, alguna idea ?
-----------------------------------------------------------------------------------------------------------------------------------------------------
hello
It happens something strange with this example ...
Only works with the image that brings the folder: D:\HMG\3.4\SAMPLES\hPDF\HMG_HPDF\hmghpdf.png
Can someone try, any ideas?
Me pasa algo extraño con este ejemplo...
Solo funciona con la imagen que trae la carpeta: D:\HMG\3.4\SAMPLES\HPDF\HMG_HPDF\hmghpdf.png
Puede alguien probarlo, alguna idea ?
-----------------------------------------------------------------------------------------------------------------------------------------------------
hello
It happens something strange with this example ...
Only works with the image that brings the folder: D:\HMG\3.4\SAMPLES\hPDF\HMG_HPDF\hmghpdf.png
Can someone try, any ideas?
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: PRINT TO PDF
Hola Andresandyglezl wrote: It happens something strange with this example ...
Only works with the image that brings the folder: D:\HMG\3.4\SAMPLES\hPDF\HMG_HPDF\hmghpdf.png
Can someone try, any ideas?
Yes, tried,
error eliminated; but I didn't like the solution
This didn't solved but made more complex the problem
I hope "father" of HMG_HPDF Mr. Rathinagiri will give us the correct solution
Happy HMG'ing
Viva INTERNATIONAL HMG 
Re: ExecuteReport( )
Gracias esgici
Yo estuve haciendo pruebas con diferentes editores de imagenes y no logré
que funcionara con el tamaño de las imagenes que envié.
-------------------------------------------------------------------------------------------
Thanks esgici
I was experimenting with different editors of images and failed
that worked with the size of the images I sent.
Yo estuve haciendo pruebas con diferentes editores de imagenes y no logré
que funcionara con el tamaño de las imagenes que envié.
-------------------------------------------------------------------------------------------
Thanks esgici
I was experimenting with different editors of images and failed
that worked with the size of the images I sent.
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- Rathinagiri
- Posts: 5481
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: ExecuteReport( )
I see that only images with color information about transparency are shown in HPDF.
If I enable this while saving the above image in GIMP, the image is shown in the PDF.
If I enable this while saving the above image in GIMP, the image is shown in the PDF.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
PRINT TO PDF
Bueno...
Ya pude lograr que se muestre la imagen ".PNG", pero con los ".JPG" continua el problema ???
La imagen que hice (que no se mostraba) la leí con un visor de imagenes llamado
"JPEGView" y le di guardar como (sin modificarla) y con eso ya la pude leer en el .PDF
-------------------------------------------------------------------------------------------------------
Well ...
I could already achieve picture ".PNG" is displayed, but with the ".JPG" continues the problem ???
The picture I made (not showed) I read an image viewer called
"JPEGView" and gave him save as (without modification) and with that and I read the .PDF
Ya pude lograr que se muestre la imagen ".PNG", pero con los ".JPG" continua el problema ???
La imagen que hice (que no se mostraba) la leí con un visor de imagenes llamado
"JPEGView" y le di guardar como (sin modificarla) y con eso ya la pude leer en el .PDF
-------------------------------------------------------------------------------------------------------
Well ...
I could already achieve picture ".PNG" is displayed, but with the ".JPG" continues the problem ???
The picture I made (not showed) I read an image viewer called
"JPEGView" and gave him save as (without modification) and with that and I read the .PDF
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- Rathinagiri
- Posts: 5481
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: ExecuteReport( )
You have to add 'type JPG' for printing JPEG file types.
Actually this you can get from i_print.ch
Type is not required for ordinary print. For PDF Print you need to mention the type.
Actually this you can get from i_print.ch
Code: Select all
#xtranslate @ <nRow> , <nCol> PRINT IMAGE <cImage> ;
WIDTH <nWidth> ;
HEIGHT <nheight> ;
[ <stretch : STRETCH> ] ;
[ <transparent: TRANSPARENT> ] ;
[ TRANSPARENTCOLOR <aTransparentColor> ];
[ TYPE <cType:JPG,PNG> ] ;
=> ;
iif( _HMG_SYSDATA \[ 513 \],_HMG_HPDF_IMAGE ( <cImage> , <nRow> , <nCol> , <nheight> , <nWidth> , <.stretch.>, <"cType"> ), _HMG_PRINTER_H_IMAGE ( _HMG_SYSDATA \[ 374 \] , <cImage> , <nRow> , <nCol> , <nheight> , <nWidth> , <.stretch.> , <.transparent.> , <aTransparentColor> ) )
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: ExecuteReport( )
Thanks for sharing the code ! I tried it with a simple example:Amarante wrote:Clearing Up ....
This routine is not of my own ... it was originally made by Rossine, who posted it on another forum and that Pablo thought was a woman. I just changed for my needs.
Run_MyProcess does not prevent the user closes their program .... you need to make use of other artifices to prevent the ever-existing, user wretched, miserable and other insults that I should not speak here to find a flaw in your program.
Another time I will show in a sample program.
------------------
Aclarar ....
Esta rutina no es de mi propia ... que fue hecho originalmente por Rossine, quien lo publicó en otro foro y que Pablo creía que era una mujer. Acabo de cambiar para mis necesidades.
Run_MyProcess no impide que el usuario cierra su programa .... lo necesario para hacer uso de otros artificios para evitar la siempre existente, el usuario desventurado, miserable y otros insultos que no debo hablar aquí para encontrar un defecto en su programa.
Otra vez voy a mostrar en un programa de ejemplo.
------------------
Esclarecendo....
Essa rotina não é de minha autoria... foi feita originalmente por Rossine, que postou ela em outro fórum e que o Pablo achava que era mulher. Eu apenas alterei para minhas necessidades.
A Run_MyProcess não impede que o usuário feche o seu programa.... você precisa fazer usar de outros artificios para impedir o sempre existente, usuário desgraçado, miseravel e outros impropérios que não devo falar aqui de achar uma falha no seu programa.
Outra hora demonstrarei em um programa exemplo.
Run_MyProcess( "notepad test.txt")
But i get the error:
Date:04/27/15 Time: 11:20:14
Error BASE/1081 Argument error: +
Called from GETFORMHANDLE(3685)
Called from RUN_MYPROCESS(46)
Called from RUNMYPROCESS(1)
Line 46 of the PRG RUN_MYPROCESS is:
SetLayeredWindowAttributes( GetFormHandle( cWin_ ), 0, 180, LWA_ALPHA )
Also the build.log contains the following error:
Cannot open EVENTS.prg, assumed external
Do i miss some code or do i do something wrong ?
- Amarante
- Posts: 182
- Joined: Fri Apr 27, 2012 9:44 pm
- DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL
- Location: Araruama-RJ, Brazil
Re: ExecuteReport( )
trmpluym,
Test by inserting the line:
#include "fileio.ch"
See the example below:
Test by inserting the line:
#include "fileio.ch"
See the example below:
Code: Select all
#include "hmg.ch"
#include "fileio.ch"
Function Main
DEFINE WINDOW Win_1 ;
ROW 0 ;
COL 0 ;
WIDTH 640 ;
HEIGHT 480 ;
TITLE 'Test' ;
WINDOWTYPE MAIN
@ 030,160 BUTTON Button_1 CAPTION "Create & Open Test.txt" ACTION {||Test1()} WIDTH 290
END WINDOW
Win_1.Center
Win_1.Activate
Return
PROCEDURE Test1()
hb_memowrit( "test.txt", "Test File..." )
Run_MyProcess( "notepad test.txt")
RETURN
/**
*
* Run_MyProcess
*
* Description: Executes an external process
* Syntax.....: Run_MyProcess( <expC1>, [expL1], [expB1], [expN1], [expN2] )
* Parameters.: <expC1> - Expression of process running
* [expL1] - Wait on process (default .T.)
* [expB1] - Block-function to be performed during the process
* [expN1] - Time (default 1)
* [expN2] - Number of times to perform the block-function (default 0)
* Return.....: expN - Result of the process
* Example....:
* Run_MyProcess( "SumatraPDF.exe " + "Certidao.PDF", .T. )
* ------ other sample -----
* hb_memowrit( "test.txt", "Test File..." )
* ? "Retorno:", Run_MyProcess( "notepad test.txt", .T., { || QOUT( "Waiting Notepad close..." ) }, 1 )
* WAIT "When you get here notepad already ended. press ENTER..."
* ? "Retorno:", Run_MyProcess( "notepad test.txt", .F. )
* WAIT "When you get here notepad is still running. press ENTER..."
* ? "Retorno:", Run_MyProcess( "notepad test.txt",, { | nCtd | QOUT( "Waiting Notepad close (" + hb_ntos( 5 - nCtd ) + ")..." ) },, 5 )
* WAIT "The Loop was closed after in 5 seconds..."
* ? "Retorno:", Run_MyProcess( "notepad test.txt",, { | nCtd | QOUT( "Forcing the closure of Notepad by returning the codeblock..." ), IIF( nCtd = 2, .F., .T. ) } )
* WAIT "The Loop was closed..."
*
*/
FUNCTION Run_MyProcess( cExecute, lWait, bBlock, nTime, nOccurs )
#define LWA_ALPHA 0x02
LOCAL cWin_ := _HMG_SYSDATA[ 316 ] // Name of the current window
LOCAL hProcess
LOCAL nCtd := 0
LOCAL nResult
LOCAL lRet
__DefaultNIL( @lWait, .T. )
__DefaultNIL( @nTime, 1 )
__DefaultNIL( @nOccurs, 0 )
hProcess := HB_ProcessOpen( cExecute )
IF hProcess <> F_ERROR
SetLayeredWindowAttributes( GetFormHandle( cWin_ ), 0, 180, LWA_ALPHA )
DO WHILE ( nResult := HB_ProcessValue( hProcess, .F. ) ) == - 1
DO EVENTS
IF .NOT. lWait
EXIT
ENDIF
nCtd += 1
IF HB_IsBlock( bBlock )
lRet := EVAL( bBlock, nCtd )
IF HB_IsLogical( lRet ) .AND. .NOT. lRet
HB_ProcessClose( hProcess, .T. )
EXIT
ENDIF
ENDIF
IF nTime > 0
HB_IdleSleep( nTime )
ENDIF
IF nCtd == nOccurs
HB_ProcessClose( hProcess, .T. )
EXIT
ENDIF
ENDDO
SetLayeredWindowAttributes( GetFormHandle( cWin_ ), 0, 255, LWA_ALPHA )
ELSE
MsgInfo( "Error Open Process" )
ENDIF
RETURN nResult
Re: ExecuteReport( )
Hi Amarante,
Works like a charm
Many thanks again for sharing the code !
Theo
Works like a charm
Many thanks again for sharing the code !
Theo