Help - Search - Members - Calendar
Full Version: OnBeforePrint event
Fast Reports forum > Fast Reports Products > FastReport 3.0
combatvc
Hello my friend,s:

I have a problem with the OnBeforerint event of frxReport

In old version (2.x) OnBeforerint event has this code:

CODE

procedure TForm1.frReport1BeforePrint(Memo: TStringList; View: TfrView);
begin
end;


so, I have this code to assign a bmp picture for assing this to runtime, because the logo is aved in a Ini file to Delphi application:


CODE

procedure TForm1.frReport1BeforePrint(Memo: TStringList; View: TfrView);
begin
   If View.Name = 'Picture1' then
   TfrPictureView(View).Picture.LoadFromFile(tLogoFile);

end;


where tLogoFile is a string with the path and name of de bmp

my surprise is that in FastReport 3, the new code for this event is:

CODE

procedure TfColores.frxCatalogoColoresBeforePrint(
 Sender: TfrxReportComponent);
begin
end;



what is the solution for this?
another method???

so, I write code with LoadFromFile in scrip report, but I do not work, because I think that this procedure no correct in FR3; always not work for example de variable that pass with [variable] not work whits this

Excuse me for my bad english

Best regards: Julio from Spain
-=Den=-
[CODE]
procedure TForm1.frxReport1BeforePrint(Sender: TfrxReportComponent);
begin
if Sender is TfrxPictureView then
TfrxPictureView(Sender).Picture.LoadFromFile(tLogoFile);
end;
mflopes
why does my delphi dosenīt acept

procedure TTermografia.MainReportBeforePrint(Sender: TfrxReportComponent);
begin
if
sender.name := 'Picture5' then
tfrxpictureview(sender).picture.loadfromfile('path&filename');
end;
E2012 Type of expression must be BOOLEAN


Thanks
gordk
it is exactly what delphi is telling you.

if
sender.name := 'Picture5' then

this is not boolean
this is
if
sender.name = 'Picture5' then
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.