OnBeforePrint event

Hello my friend,s:

I have a problem with the OnBeforerint event of frxReport

In old version (2.x) OnBeforerint event has this 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:

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:
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

Comments

  • edited 7:35AM
    [code]
    procedure TForm1.frxReport1BeforePrint(Sender: TfrxReportComponent);
    begin
    if Sender is TfrxPictureView then
    TfrxPictureView(Sender).Picture.LoadFromFile(tLogoFile);
    end;
  • edited August 2009
    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
  • gordkgordk St.Catherines On. Canada.
    edited 7:35AM
    it is exactly what delphi is telling you.

    if
    sender.name := 'Picture5' then

    this is not boolean
    this is
    if
    sender.name = 'Picture5' then

Leave a Comment