I'm not loadding the report from a template. Let me explain: (Please, forgive my english!)
In run time, based in a flag changed by the user , I change some visual characteristcs of some components. So the user load the report (TppReport.Print); If the user change the flag (to the default), and try to print again the report, I'd like to restore the original layout of the Report.
Comments
you have to reload the template.
HTH,
Chris Ueberall;
I'm not loadding the report from a template.
Let me explain: (Please, forgive my english!)
In run time, based in a flag changed by the user , I change some visual
characteristcs of some components. So the user load the report
(TppReport.Print);
If the user change the flag (to the default), and try to print again the
report, I'd like to restore the original layout of the Report.
???
Thanks again.
Andre
TForm1...
private
FStream: TMemoryStream;
procedure MenuRevertOnClick(Sender: TObject);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses
ppTypes, Menus;
procedure TForm1.Button1Click(Sender: TObject);
begin
ppDesigner1.ShowModal;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
lMenuItem: TMenuItem;
begin
lMenuItem := TMenuItem.Create(ppDesigner1.Menu);
lMenuItem.Caption := 'Revert';
lMenuItem.OnClick := MenuRevertOnClick;
ppDesigner1.Menu.Items[0].Insert(4, lMenuItem);
FStream := TMemoryStream.Create;
ppReport1.Template.SaveToStream(FStream);
end;
procedure TForm1.MenuRevertOnClick(Sender: TObject);
begin
ppReport1.Template.LoadFromStream(FStream);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FStream.Free;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
I'll try....
Regards,
Andre