Page 1 of 1

Mr Rao, How insert image using oBrw:Report ? (Solved)

PostPosted: Mon Aug 07, 2017 12:47 pm
by albeiroval
Good day,

I need to include an image in a report using xbrowse. I am using this code :

Code: Select all  Expand view

bSetup := {|oRep| oRep:saybitmap(,, "c:\sistema\logo.bmp")

REDEFINE XBROWSE oBrw ID 100 OF oDlg;
    DATASOURCE oQry;
    ...

oBrw:Report("Report xbrowse with image",,, bSetup)
 


But it does not work

Re: Mr Rao, How insert image using oBrw:Report ?

PostPosted: Mon Aug 14, 2017 4:27 pm
by albeiroval
The following code works.

Code: Select all  Expand view

 bImage := {|oRep| oRep:SayBitmap(0.1, 0.1, "c:\images\logo.bmp")}
 bStart := {|oRep| oRep:bStartPage := bImage}
   
 oBrw:Report("Reporte xbrowse con imagen en titulo",,, bStart)
 

Re: Mr Rao, How insert image using oBrw:Report ? (Solved)

PostPosted: Wed Aug 16, 2017 9:35 am
by ukoenig
Albeiro,

thank You, works fine.
I tested and added the solution as a new button to my sample-collector
a Logo added to the report

Image

Image

TO EXCEL

@ 250, 25 BTNBMP oBtn1 OF oFld1:aDialogs[1] ;
SIZE 80, 15 PIXEL 2007 ;
NOBORDER ;
PROMPT " &oBrw1:ToExcel() " ;
FILENAME c_Path1 + "EXCEL1.bmp" ;
ACTION ( oBrw1:ToExcel(), ;
TOP_CLOSE(1, "Excel" ) ) ;
FONT oSFont ;
LEFT
oBtn1:cToolTip = { "Excel","EXPORT", 1, CLR_BLACK, 14089979 }
oBtn1:SetColor( 0, )


REPORT ( with logo )

@ 250, 110 BTNBMP oBtn2 OF oFld1:aDialogs[1] ;
SIZE 80, 15 PIXEL 2007 ;
NOBORDER ;
PROMPT " &oBrw1:Report() " ;
FILENAME c_Path1 + "REPORT.bmp" ;
ACTION ( bImage := {|oRep| oRep:SayBitmap(0.2, 7, c_Path1 + "Customer.bmp")}, ;
bStart := {|oRep| oRep:bStartPage := bImage}, ;
oBrw1:Report("Xbrowse report with image",,, bStart) ) ;
FONT oSFont ;
LEFT
oBtn2:cToolTip = { "Report","EXPORT", 1, CLR_BLACK, 14089979 }
oBtn2:SetColor( 0, )


regards
Uwe :D

Re: Mr Rao, How insert image using oBrw:Report ? (Solved)

PostPosted: Wed Aug 16, 2017 2:28 pm
by albeiroval
Uwe,

Very good example

:D