I have a TppReport on a form, but I want to create a TppReport at runtime and then assign it everything that is in the first report that I created at design time. How do i do this?
You will need to use the Report.Template property to access the template of the report you create at run-time and then load that template into the other report already on the form. Here is an example of what you might do:
Comments
You will need to use the Report.Template property to access the template of
the report you create at run-time and then load that template into the other
report already on the form. Here is an example of what you might do:
var
lMemoryStream: TMemoryStream;
begin
lMemoryStream := TMemoryStream.Create;
try
myDynamicReport.Template.SaveToStream(lMemoryStream);
myReport.Template.LoadFromStream(lMemoryStream);
myReport.Print;
finally
lMemoryStream.Free;
end;
end;
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com