Is this the bug of Fastreport in saving file

The component on my form.

Table1, DataSource1
frReport1, frRTFExport1, frDBDataSet1
RadioButton1, RadioButton2, RadioButton3
Button1

if radiobutton1.Checked then frreport1.LoadFromFile('001.frf') else
if radiobutton2.Checked then frreport1.LoadFromFile('002.frf') else
if radiobutton3.Checked then frreport1.LoadFromFile('003.frf');

frreport1.ShowReport;



When I select the report through radiobutton, it show report in order 001, 002, and 003

The Problem is... when I preview report 001.frf then save to rtf file.. then close the preview window. and select another report to show. but it always show report 001.frf. ;) What happen. I use the fastreport version 2.52

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 8:21AM
    Hi
    if you are trying to give an choice of which report to run
    try using a radio group then in preview button
    use a case statement to get the radio groups index and then
    when loading and runnig reports call report components clear method
    before calling loadfromfile method
    ie onclick of preview button
    begin
    frreport1.clear; // obvious
    case radiogroup1.itemindex of
    0:
    begin
    set props of report components or other items here
    frreport1.loadfromfile('001.frf)
    end;
    1:
    begin
    set props of report components or other items here
    frreport1.loadfromfile('002.frf)
    end
    2:
    begin
    set props of report components or other items here
    frreport1.loadfromfile('003.frf)
    end;
    end; // end of case
    frreport1.showreport; // or whatever other method you want
    end;
    regards ;)
  • edited 8:21AM
    Thank you very much for your help both Gordk and Alexander Tzyganenko for the advice of current working directory by using
    LoadFromFile(ExtractFilePath(Application.ExeName) + '001.frf')
    

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.