FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour PRINT IMAGE on REPORT
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
PRINT IMAGE on REPORT
Posted: Thu Mar 17, 2011 11:54 PM

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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: PRINT IMAGE on REPORT
Posted: Sat Mar 26, 2011 09:55 AM

any solution please ?

Best Regards, Saludos



Falconi Silvio
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: PRINT IMAGE on REPORT
Posted: Sat Mar 26, 2011 10:05 AM
Silvio...

i think LoadBitmap has wrong parameter

LoadBitmap( <hInst>, <cnBitmap> ) โ€“> hBitmap

http://wiki.fivetechsoft.com/doku.php?id=fivewin_function_loadbitmap
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: PRINT IMAGE on REPORT
Posted: Sun Mar 27, 2011 08:11 AM
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
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: PRINT IMAGE on REPORT
Posted: Fri Apr 01, 2011 07:52 PM

Silvio

can you post a sample?
please....

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: PRINT IMAGE on REPORT
Posted: Mon Apr 04, 2011 07:32 AM
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






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

as you can see here :


Best Regards, Saludos



Falconi Silvio
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: PRINT IMAGE on REPORT
Posted: Mon Apr 04, 2011 02:13 PM
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 (fw): Select all Collapse
Local aLabBitmap := { TImage:Define( 'SM_AULE' ), TImage:Define( 'SM_UFF' ), TImage:Define( 'SM_LAB' ) }

and
Code (fw): Select all Collapse
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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: PRINT IMAGE on REPORT
Posted: Mon Apr 04, 2011 03:22 PM

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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: PRINT IMAGE on REPORT
Posted: Mon Apr 04, 2011 03:26 PM
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' ) }














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



Falconi Silvio
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: PRINT IMAGE on REPORT
Posted: Mon Apr 04, 2011 03:50 PM

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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: PRINT IMAGE on REPORT
Posted: Mon Apr 04, 2011 03:58 PM

thanks to you mr rao !!!!

Best Regards, Saludos



Falconi Silvio

Continue the discussion