Mega Search
23.2 Million


Sign Up

Make a donation  
Loading a bmp or jpg into rave report  
News Group: embarcadero.public.delphi.reporting-charting

Hello everyone. I'm using Delphi 2007 Professional with Rave Reports version 7.5.  I need to pass a bmp file location and file name into the Rave report to have the Bitmap1 field that is defined on the Rave report such that the file name is loaded.  How can I use my Delphi program to instruct my Rave report to load the desired image file and have it incorporated in the final pdf report?

Any help would be greatly appreciated.

Greg.

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 3-Jun-2014, at 11:20 PM EST
From: Greg Madison
 
Re: Loading a bmp or jpg into rave report  
News Group: embarcadero.public.delphi.reporting-charting
You need to put this code into the "OnDecodeImage" property of an RVSystem component. Put "JPEG" in the Uses clause.

if ImageType = 'JPG' then
begin
  try
    Image.LoadFromStream(ImageStream);
    Image.DIBNeeded;
    BitMap.Assign(Image);
  finally
    Image.Free;
  end;
end;

I get a graphic path as a variable and use the following code...

Bitmap := TBitmap.Create;
Bitmap.LoadFromFile(GraphicPath);
PrintBitmapRect(XPos1,YPos1,XPos2,YPos2,Bitmap);
Bitmap.Free;

George

> {quote:title=Greg Madison wrote:}{quote}
> Hello everyone. I'm using Delphi 2007 Professional with Rave Reports version 7.5.  I need to pass a bmp file location and file name into the Rave report to have the Bitmap1 field that is defined on the Rave report such that the file name is loaded.  How can I use my Delphi program to instruct my Rave report to load the desired image file and have it incorporated in the final pdf report?
> 
> Any help would be greatly appreciated.
> 
> Greg.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 9-Oct-2014, at 8:16 AM EST
From: George Winkler
 
Re: Loading a bmp or jpg into rave report  
News Group: embarcadero.public.delphi.reporting-charting
On 04/06/2014 12:50 PM, Greg Madison wrote:
> Hello everyone. I'm using Delphi 2007 Professional with Rave Reports version 7.5.  I need to pass a bmp file location and file name into the Rave report to have the Bitmap1 field that is defined on the Rave report such that the file name is loaded.  How can I use my Delphi program to instruct my Rave report to load the desired image file and have it incorporated in the final pdf report?
>
> Any help would be greatly appreciated.
>
> Greg.
>
Hi Greg

I think you would have to identify the bitmap field object in your RAV 
file then in code set the filename before executing the report.
Here is some code I use (with a TraveDataText). Not sure what the bitmap 
field object is


With rvProjectManager do begin
  Open;
  MyPage := FindRaveComponent('ReportName.MainPage',nil) as TRavePage;
  if MyPage <> nil  then begin
   MyDataText := FindRaveComponent('TitleText', MyPage) as TRaveDataText;
   if MyDataText <> nil then
     MyDataText.color := clRed;
  end;
end;

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 8-Oct-2014, at 4:09 PM EST
From: Tony Christiansen