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 12:51PM
    [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 12:51PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.