PRINT IMAGE on REPORT

PRINT IMAGE on REPORT

Postby Silvio » 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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: PRINT IMAGE on REPORT

Postby Silvio » Sat Mar 26, 2011 9:55 am

any solution please ?
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

Postby Daniel Garcia-Gil » 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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: PRINT IMAGE on REPORT

Postby Silvio » Sun Mar 27, 2011 8: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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: PRINT IMAGE on REPORT

Postby Daniel Garcia-Gil » Fri Apr 01, 2011 7:52 pm

Silvio

can you post a sample?
please....
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: PRINT IMAGE on REPORT

Postby Silvio » Mon Apr 04, 2011 7: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

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
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: PRINT IMAGE on REPORT

Postby nageswaragunupudi » Mon Apr 04, 2011 2: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: Select all  Expand view
Local aLabBitmap := { TImage:Define( 'SM_AULE' ), TImage:Define( 'SM_UFF' ), TImage:Define( 'SM_LAB' ) }
 

and
Code: Select all  Expand view
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
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: PRINT IMAGE on REPORT

Postby Silvio » Mon Apr 04, 2011 3: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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: PRINT IMAGE on REPORT

Postby Silvio » Mon Apr 04, 2011 3: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' ) }




Image









I think we must change something to report class !!!!!
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

Postby nageswaragunupudi » Mon Apr 04, 2011 3: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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: PRINT IMAGE on REPORT

Postby Silvio » Mon Apr 04, 2011 3:58 pm

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

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests