PRINT IMAGE on REPORT

Post Reply
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

PRINT IMAGE on REPORT

Post by Silvio »

Local aLabBitmap := {'SM_AULE','SM_UFF','SM_LAB'}

.....

COLUMN TITLE "Tipo" DATA " " SIZE 35 FONT 2 CENTER IMAGE IMGDATA loadBitmap(aLabBitmap[LB->TIPO]) HEIGHT 2 ALPHALEVEL 128

WHEN LB->TIPO IS A NUMBER ( 1 , 2 OR 3)

i HAVE THE IMAGES ON RESOURCES , CAN i PRINT THEM ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: PRINT IMAGE on REPORT

Post by Silvio »

any solution please ?
Best Regards, Saludos

Falconi Silvio
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: PRINT IMAGE on REPORT

Post by Daniel Garcia-Gil »

Silvio...

i think LoadBitmap has wrong parameter

LoadBitmap( <hInst>, <cnBitmap> ) –> hBitmap

http://wiki.fivetechsoft.com/doku.php?i ... loadbitmap
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: PRINT IMAGE on REPORT

Post by Silvio »

Daniel,
( seeing the instal.prg)

I made
Local aLabBitmap := {'SM_AULE','SM_UFF','SM_LAB'}
...
hBmpText1 = LoadBitmap( GetResources(), aLabBitmap[LB->TIPO] )

COLUMN TITLE "Tipo" DATA " " SIZE 35 FONT 2 CENTER IMAGE IMGDATA hBmpText1 HEIGHT 6 ALPHALEVEL 128


it not print anything
Best Regards, Saludos

Falconi Silvio
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: PRINT IMAGE on REPORT

Post by Daniel Garcia-Gil »

Silvio

can you post a sample?
please....
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: PRINT IMAGE on REPORT

Post by Silvio »

I try with bitmap from source and it run ok

when I insert resources not run

#include "FiveWin.ch"
#include "report.ch"

STATIC oReport

Function Reptext()

Local aLabBitmap := {'SM_AULE','SM_UFF','SM_LAB'}

Local hBmpText1

USE LB INDEX LB NEW

REPORT oReport TITLE "test" ;
CAPTION "teat" ;
PREVIEW

COLUMN TITLE "cod" DATA LB->concep
COLUMN TITLE "desc" DATA LB->Descri
hBmpText1 = LoadBitmap( GetResources(), aLabBitmap[LB->TIPO] )

COLUMN TITLE "Tipo" DATA " " SIZE 35 IMAGE IMGDATA hBmpText1 HEIGHT 6 ALPHALEVEL 128

END REPORT

ACTIVATE REPORT oReport

CLOSE LB

RETURN NIL



the bitmaps ara boxes of different colours

LB->tipo value can be 1 2 or 3

Image




I try to print a report but from sources sample ".\bitmaps\blalbla.bmp" and it run ok

as you can see here :


Image
Best Regards, Saludos

Falconi Silvio
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: PRINT IMAGE on REPORT

Post by nageswaragunupudi »

At present, IMGDATA should return either file name of an image (bitmap) file or an image buffer or an image object.

You may please try changing the two lines like this:

Code: Select all

Local aLabBitmap := { TImage:Define( 'SM_AULE' ), TImage:Define( 'SM_UFF' ), TImage:Define( 'SM_LAB' ) }
 
and

Code: Select all

COLUMN TITLE "Tipo" DATA "" SIZE 35 IMAGE IMGDATA aLabBitmap[ LB->TIPO ] HEIGHT 6 ALPHALEVEL 128
 
After printing is over, please destroy the Image objects.

Please let us know if this works.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: PRINT IMAGE on REPORT

Post by Silvio »

no,

Error description: Error BASE/1003 Variabile inesistente: TIMAGE

Called from: source\TInforme.prg => TINFORME:REPORT(567)

line 567 Local aLabBitmap := { TImage:Define( 'SM_AULE' ), TImage:Define( 'SM_UFF' ), TImage:Define( 'SM_LAB' ) }
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: PRINT IMAGE on REPORT

Post by Silvio »

OK NOW RUN OK

Local aLabBitmap := { TImage():Define( 'SM_AULE' ), TImage():Define( 'SM_UFF' ), TImage():Define( 'SM_LAB' ) }

instad of


Local aLabBitmap := { TImage:Define( 'SM_AULE' ), TImage:Define( 'SM_UFF' ), TImage:Define( 'SM_LAB' ) }




Image









I think we must change something to report class !!!!!
Best Regards, Saludos

Falconi Silvio
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: PRINT IMAGE on REPORT

Post by nageswaragunupudi »

Sorry for writing TImage:Define instead of TImage():Define. Glad you corrected it.

We can expect FWH to make this more flexible in next versions.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: PRINT IMAGE on REPORT

Post by Silvio »

thanks to you mr rao !!!!
Best Regards, Saludos

Falconi Silvio
Post Reply