First Report

Hello,

Newly downloaded FR 2.51 and tried a very simple report. well it works fine when it comes to IDE.

but the problem appears when I want to display the report during run-time. I already encountered two topics about this, and I hope someone will answer me with this problem.

here's the basic code:


procedure TForm1.Button1Click(Sender: TObject);
begin
frreport1.LoadFromFile('d:\cd 2\delphi\report\test.frf');
FRREPORT1.PrepareReport;
frreport1.ShowReport;
end;


the above dont work at all. so any workaround?

thank you.

Comments

  • SamuraySamuray Administrator
    edited 3:29PM
    1. Use this code:
    frReport1.LoadFromFile('filename');
    if frReport1.PrepareReport then
    frreport1.ShowPreparedReport;
    or
    frReport1.LoadFromFile('filename');
    frReport1.ShowReport;

    ShowReport include PrepareReport and ShowPreparedReport.

    2. Filename must exist.
    3. If you give any erroros about missing components - place required component on form.
  • edited 3:29PM
    Thank you very much now it is working.

Leave a Comment