Michel
2007-08-21 18:50:12 UTC
Hi people,
I'm trying put a TBitmap in my report, but when my report is generating
an error occurr:
"Access violation at address 026B72F7 in module 'RvEngine50.bpl'. Write
of address 00003FFC."
follow the article that I used like example.
http://www.nevrona.com/Default.aspx?tabid=136
"Tip #92 - Dynamic Bitmaps in Report
Category
Rave - General
Question
How can I print in a report created in Rave Visual Designer a
bitmap that is dynamically generated?
Solution
In Rave 5 there are text (DataText) and memo (DataMemo)components
that allow their contents programatically set up via project parameters.
The standard bitmap component doesn't have this behavior. Here are the
steps we can follow to combine the power of visually designed reports
and still have dynamically generated bitmaps included in the reports. In
Delphi we generate a bitmap contents by using a TBitmap. As the last
step we save the bitmap on disk by using TBitmap.SaveToFile. For the
purpose of this demo, we save the bitmap in the same folder as the main
application (Application.ExeName) and we name it 'tmp_rep.bmp'. We add a
TRvProject and a TButton on our form. Change the name of the button to
btnPrint. In the OnClick event write the following code:
procedure TForm1.btnPrintClick(Sender: TObject);
var
myBmpName: string;
begin
myBmpName := ExtractFilePath(Application.ExeName) + 'tmp_rep.bmp';
with RvProject1 do
begin
Open;
try
SetParam('pMyReportImage', myBmpName);
ExecuteReport('Report1');
finally
Close;
end;
end;
end;
Open the Rave Designer and add a Bitmap on the Page1 of the
report. Click on RaveProject (tree on the right) and then on Parameters
property on the right. Add pMyReportImage as a parameter. Click on the
newly added Bitmap and set it's name to MyBitmap. While the Bitmap is
still selected, click on Event Editor and choose OnBeforePrint. Type in
the following code:
MyBitmap.FileLink := RaveProject.GetParam('pMyReportImage');
Click Compile and then Save the project. Go back to Delphi,
compile and run the application. The bitmap you create dynamically in
Delphi is now displayed in the report without problems.
Tip created by Catalin Ionescu - Email : ***@techvision.ro - Web :
http://www.techvision.ro "
I'm trying put a TBitmap in my report, but when my report is generating
an error occurr:
"Access violation at address 026B72F7 in module 'RvEngine50.bpl'. Write
of address 00003FFC."
follow the article that I used like example.
http://www.nevrona.com/Default.aspx?tabid=136
"Tip #92 - Dynamic Bitmaps in Report
Category
Rave - General
Question
How can I print in a report created in Rave Visual Designer a
bitmap that is dynamically generated?
Solution
In Rave 5 there are text (DataText) and memo (DataMemo)components
that allow their contents programatically set up via project parameters.
The standard bitmap component doesn't have this behavior. Here are the
steps we can follow to combine the power of visually designed reports
and still have dynamically generated bitmaps included in the reports. In
Delphi we generate a bitmap contents by using a TBitmap. As the last
step we save the bitmap on disk by using TBitmap.SaveToFile. For the
purpose of this demo, we save the bitmap in the same folder as the main
application (Application.ExeName) and we name it 'tmp_rep.bmp'. We add a
TRvProject and a TButton on our form. Change the name of the button to
btnPrint. In the OnClick event write the following code:
procedure TForm1.btnPrintClick(Sender: TObject);
var
myBmpName: string;
begin
myBmpName := ExtractFilePath(Application.ExeName) + 'tmp_rep.bmp';
with RvProject1 do
begin
Open;
try
SetParam('pMyReportImage', myBmpName);
ExecuteReport('Report1');
finally
Close;
end;
end;
end;
Open the Rave Designer and add a Bitmap on the Page1 of the
report. Click on RaveProject (tree on the right) and then on Parameters
property on the right. Add pMyReportImage as a parameter. Click on the
newly added Bitmap and set it's name to MyBitmap. While the Bitmap is
still selected, click on Event Editor and choose OnBeforePrint. Type in
the following code:
MyBitmap.FileLink := RaveProject.GetParam('pMyReportImage');
Click Compile and then Save the project. Go back to Delphi,
compile and run the application. The bitmap you create dynamically in
Delphi is now displayed in the report without problems.
Tip created by Catalin Ionescu - Email : ***@techvision.ro - Web :
http://www.techvision.ro "