Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

MyCloseButtonPreviewPlugin

edited June 2002 in General
I downloaded the file:
http://www.digital-metaphors.com/tips/myCloseButtonPreviewPlugin.zip

This works great. However, it would be very helpful if you could
explain how the plugin works. The only reference I can find to it is
in the project file. How does that cause it to become effective in
all my reports.

Thanks, Sidney

Comments

  • edited June 2002
    To make the preview plugin work, you need to simply register any
    TppCustomPreview descendent. It will be used in all of your reports as long
    as it is registered. You can use the default by unregistering yours and
    registering the default again.

    You don't need to create your own TppPrintPreview object, as the preview
    plugin (TppPreview) is what you need to replace. You should only have to
    call Report.Print in order for the plugin to be used to preview.

    The preview plugin architecture exists in order to allow you to replace the
    preview form in the preview tab of the end user designer.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited June 2002
    It works because when the preview is to be created, it pulls the plugin from
    a registration scheme. Look in the TppPrintPreview.FormCreate and in the
    TppDesignerWindow.Create (ppPrvDlg.pas and ppDsgner.pas) methods and you'll
    find:

    FPreview := TppPreviewPlugIn.CreateInstance(Self);

    See ppPreview.pas for the TppPreviewPlugIn class which provides the
    register/unregister mechanism.

    The FPreview object is used to connect the viewer object up in the designer.
    The FPreviewForm is used in the producer (report ancestor) in the ppProd.pas
    function TppProducer.CreatePreviewForm: TppCustomPreviewer.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.