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

Where to Find Custom Preview Tutorial

edited July 2003 in General
Report Builder v 6.03
Delphi 5 Enterprise

Where is the tutorial on how to create a custom print preview form?


Bill

Comments

  • edited July 2003
    Found the tutorial in the Report Builder Developers guide.

  • edited July 2003
    When I do the tutorial the part to
    Create a Customized Print Preview Form
    seems to be missing something
    When I follow the instructuions and open ppPrvDlg from RBuilder\Source
    directory
    the form that loads does not have anything on it.

    So I am at a loss when step 5 instructions say:
    "Select the panel at the top of the form (named pnlPreviewBar)."

    Where is it?!?!?

    Bill





  • edited July 2003
    Hi Bill,

    Sorry, this section of the Developer's Guide needs to be updated. Below is
    an article and example that will get you on the right track.

    -----------------------------------------
    Article: Creating a Preview Plugin
    -----------------------------------------

    Q: I've followed the tutorials and registered a Preview Form replacement but
    that did not affect the TppDesigner's Preview workspace.


    A: Do not use the form replacement, but rather, there is a different
    architecture built into the preview form that is registered by default.



    You will need to register a TppPreview descendent. The class you register
    is used to create the preview controls inside the standard print preview
    form and the designer preview workspace.


    Here is an example of creating a simple custom preview that access the
    viewer its been assigned in order to change the page color. You can also do
    more advanced operations such as adding and removing buttons and change the
    behavior of the preview form. Access the inherited controls via. protected
    properties and override the virtual methods in order to customize behavior.

    Open ppPreview.pas and view the TppPreview class as a guide to create a
    custom preview descendent.


    unit MyPreviewPlugin;

    interface

    uses
    ppPreview;

    type
    TMyPreviewPlugin = class(TppPreview)
    public
    procedure BeforePreview; override;

    end;


    implementation

    uses
    Graphics;


    procedure TMyPreviewPlugin.BeforePreview;
    begin
    inherited BeforePreview;

    Viewer.PageColor := clRed;

    end;

    initialization
    TppPreviewPlugIn.Register(TMyPreviewPlugin);

    finalization
    TppPreviewPlugIn.UnRegister(TMyPreviewPlugin);

    end.

    -------------------------------------------------------------
    http://www.digital-metaphors.com/tips/AddControlsToPreview.zip

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.