Loading a bmp or jpg into rave report |
|
Re: Loading a bmp or jpg into rave report |
|
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.
|
Re: Loading a bmp or jpg into rave report |
|
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;
|