6.01 and Preview
In the previous release a change the preview unit to position and size the
preview form in the form.oncreate event and I save the last position and
size in the form.onclose event.
With the new preview form an a setup the position as show in the help file.
But can I access the previw.onclose event ?
My updated preview form still seems to works fine with the new release. If I
can not access the form.onclose event, do I miss anything when I use the old
preview unit ?
Albert Kessler
preview form in the form.oncreate event and I save the last position and
size in the form.onclose event.
With the new preview form an a setup the position as show in the help file.
But can I access the previw.onclose event ?
My updated preview form still seems to works fine with the new release. If I
can not access the form.onclose event, do I miss anything when I use the old
preview unit ?
Albert Kessler
This discussion has been closed.
Comments
component.
You should be able to access the form like this:
procedure TForm1.ppReport1PreviewFormClose(Sender: TObject);
begin
showmessage(IntTostr(ppReport1.PreviewForm.Top));
showmessage(IntTostr(ppReport1.PreviewForm.Left));
showmessage(IntTostr(ppReport1.PreviewForm.Width));
showmessage(IntTostr(ppReport1.PreviewForm.Height));
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
events.
I have hundreds of reports to change. Wouldn't it be possible to override
the Previewcreate and Previewclose events of the report just after loadding
them from a file ?
All Previewcreate events should call the same Mypreviecreate procedure and
the Previewclose events should call the MyPreviewclose procedure.
procedure LoadRTM(PP: TppReport; FN:String);
Begin
pp.Template.Filename:=TemplatesPath + FN;
pp.Template.LoadFromFile;
pp.Reset;
.....
Albert Kessler
for the OnPreviewFormClose and OnPreviewFormCreate events:
myReport.Template.LoadFromFile;
myReport.OnPreviewFormCreate := MyPreviewCreate;
myReport.OnPreviewFormClose := MyPreviewClose;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
myReport.OnPreviewFormCreate := MyPreviewCreate;
and the define
Procedure MyPreviewCreate;
Begin
....
end;
then I get an error "incompatible types: pointer to method and regular
method"
Dont I have to override this event ? Can you help me with this ?
Thank you, Albert Kessler
MyPreviewCreate should be method declaration in the TForm descendant that
holds the RB components, ie.
procedure TMyMainForm.MyPreviewCreate(Sender: TObject);
--
elektronik-labor Carls GmbH & Co. KG
Stefan Paege
Kontakt: +49 (0)5973 9497-23 Fax: +49 (0)5973 9497-16