Composite Report
Hi,
I create a report into two forms in Delphi. The reports use the form Events to layout controls and others processes.
I create a composite report by this way:
The first report is Ok but not the second because it can't call his events form.
Is there a solution to use the events of the second report's form?
If not, can I prepare the second report, save it and add it to the first ?
Thanks
I create a report into two forms in Delphi. The reports use the form Events to layout controls and others processes.
I create a composite report by this way:
myFormReport1.frxReport.PrepareReport(True);
//
myStream := TMemoryStream.Create;
try
myFormReport2.frxReport.SaveToStream(myStream);
myStream.Seek(0, soFromBeginning);
myFormReport1.frxReport.LoadFromStream(myStream);
finally
myStream.Free;
end;
//
myFormReport1.frxReport.PrepareReport(False);
myFormReport1.frxReport.ShowPreparedReport;
The first report is Ok but not the second because it can't call his events form.
Is there a solution to use the events of the second report's form?
If not, can I prepare the second report, save it and add it to the first ?
Thanks
Comments
Something like this:
Now, that code is very simple, and work with very simple reports.
However, some problems must be worked around, as you will need to load all datasources as well into the main report object (not shown in the code above).
Also, you need to rename datasources and parameters that have the same name in all reports. And if you do that, you will have to update all the fields that reference them to use the new names.
If you design your reports from the ground with unique names for everything, you will be free of most problems.
I suggest you try the code above with simple reports without any use of datasources, just to see if it's applicable to you, then move forward step by step, by adding one datasource with only one memoview referencing it in the report.
And by the way, if you have script code in your reports, you will have to find a way to merge them too. It can be done, because I did it.
I hope it helps
Can you please put here these your functions?
Thanks.