Report Preview Issue

edited 3:29PM in FastReport 4.0
Hi,

I have a Delphi program that calls two separate Fast Reports. When I have the reports in preview mode, the program stops at the preview of the first one, and not until I close that preview window, does the program continue and run the second report.

Basically I don't want it to work like that....I want the program to run all the way through leaving two report windows.

I have set the following settings on the TfrxReport":
PreviewOptions.MDIChild = False;
PreviewOptions.Modal = False;


Doesn't anyone know how to make this work the way I want it to?

Thank You!

Comments

  • edited 3:29PM
    Bridget wrote: »
    Hi,

    I have a Delphi program that calls two separate Fast Reports. When I have the reports in preview mode, the program stops at the preview of the first one, and not until I close that preview window, does the program continue and run the second report.

    Basically I don't want it to work like that....I want the program to run all the way through leaving two report windows.

    I have set the following settings on the TfrxReport":
    PreviewOptions.MDIChild = False;
    PreviewOptions.Modal = False;


    Doesn't anyone know how to make this work the way I want it to?

    Thank You!

    Try

    procedure ShowReport(RptName: String);
    Var
    Rpt: TfrxReport;
    begin
    Rpt := TfrxReport.Create(Nil);
    Rpt.PreviewOptions.Maximized := False;
    Rpt.PreviewOptions.Modal := False;
    Rpt.LoadFromFile(RptName);
    Rpt.PrepareReport();
    Rpt.ShowPreparedReport();
    end;


    Call for each report. Modify as needed.

    You can also load both reports into the same preview window and have report 1 = page 1 and report 2 = page 2. As a quick example:

    procedure ShowReport(RptName1: String; RptName2: String);
    Var
    Rpt: TfrxReport;
    begin
    Rpt := TfrxReport.Create(Nil); //or use the frxReport control
    Rpt.PreviewOptions.Maximized := False;
    Rpt.PreviewOptions.Modal := False;
    Rpt.LoadFromFile(RptName1);
    Rpt.PrepareReport(false);
    Rpt.LoadFromFile(RptName2);
    Rpt.PrepareReport(false);
    Rpt.ShowPreparedReport();
    end;

  • edited 3:29PM
    Thank you so much for the input! However, the first option didn't quite work. The program did run all the way through, but when it was done there were no preview windows.

    Also, the second option wouldn't work in my case because I have all the printing/previewing functionality in a separate function.

    Any more ideas would be greatly appreciated! Thank you!


  • edited 3:29PM
    Bridget wrote: »
    Thank you so much for the input! However, the first option didn't quite work. The program did run all the way through, but when it was done there were no preview windows.

    Also, the second option wouldn't work in my case because I have all the printing/previewing functionality in a separate function.

    Any more ideas would be greatly appreciated! Thank you!

    Bridget,

    The first one should work. I just made a new project, placed a button on the form and pasted the code into the click event on the button:

    procedure TForm8.Button1Click(Sender: TObject);
    Var
    Rpt: TfrxReport;
    begin
    Rpt := TfrxReport.Create(Nil);
    Rpt.PreviewOptions.Maximized := False;
    Rpt.PreviewOptions.Modal := False;
    Rpt.LoadFromFile('test.fr3');
    Rpt.PrepareReport();
    Rpt.ShowPreparedReport();

    end;

    It works. I'm running Delphi 2010, with FastReports 4.9.52. What version of Fastreports & Delphi are you using? Are you sure you are calling ShowPreparedReport?

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.