I've written an MDI-Application which reads Data in from an old-DOS
Application via INI-Files.
In this Application, I have a 5 Forms, each with 30 Reports on it.
I use the Procedure tfrxReport.BeginDoc of each Report, in which I read
Data into 6000 Variables with the following Code:
Variables['Label1'] := '''' + ReadString(Section1, 'Label1', '?') + '''';
ReadString uses TIniFile to get Data from INI-Files, each Variable in
Report stands for one value in the INI-File.
Each Report has about 6000 Labels to show Data.
Now, one Unit with 30 Reports has about 10 MB Size and about 210000
Lines of Code, the compiled Application now about 1.3 Million Lines of
Code and a Size of 30 MB.
When I open up my Application and each Form is created and initialized,
the memory use is about 500 MB.
But now I reach the Limits of Delphi, the Delphi Compiler quits with
Error E2283: Too much local Constants, use shorter Procedures
Now I've seen in the Examples Folder of FastReports the Example of
"MDI-Designer" and wants to use this to create my Reports. How can I
create 30 Reports with one frxReport on the Form as MDI Window ?
My thoughts are to create about 30 Reports with one Report on the Form
and frxReport.Create for each instance, but in every Report, i need the
OnBeginDoc or onNeedValue Event to read Data in. What can I do ?
When I call frxReport.Create, with the second call, I get AVs.
Thanks for your Tipps...
You can create one OnBeginDoc event for all reports objects, just
assing this function when create new instance of TfrxReport. Inside
function you can use TfrxReport(Sender) to get a current report object.
--
Best regards,
Michael Philippenko mailto:mic...@fast-report.com
Fast Reports - Reporting must be Fast!
http://www.fast-report.com
Hi Michael,
thank you much for leading me into the right Direction.
Can you show me some Code Snippets to do that ?
How can I create 30 MDI-Reports with one Template and one OnBeginDoc
Routine ?
Can I use your Example of MDI-Designer in Demos-Directory to do that ?
Instead starting separate Designers I want to start separate Reports as
MDI-Windows ? How can I achieve this ?
Thomas
function TfrxReportList.CreateNewReport: TfrxReport;
begin
Result := TfrxReport.Create(nil);
Result.CreateUniqueName;
Result.PreviewOptions.MDIChild := True;
Result.PreviewOptions.Modal := False;
Result.EngineOptions.DestroyForms := False;
Result.OnBeginDoc := ReportOnBeginDoc;
FReportList.Add(Result);
end;
procedure TMainForm.FileNew1Execute(Sender: TObject);
begin
with FReportList.CreateNewReport do
begin
ShowReport();
end;
end;
procedure TMainForm.ReportOnBeginDoc(Sender: TObject);
begin
with TfrxReport(Sender) do
begin
// Your Code
end;
end;