Report Preview Issue
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!
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
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;
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?