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

RB7 Outline in preview?

edited February 2006 in General
Hi,

how can I simply change the dimensions of the outline tree in a standard
preview, like the preview dimensions itself?

Background: We've some node descriptions which are larger than the outline
tree object, and users complain they always have to resize the tree by
moving the 'slider' between the nodes and the preview.

Another short question: Does it work and does it make sense to put
TppReport components onto forms which are not viewed but just working as
containers for the report and the datasources? We're having at least 4
TppReport components on the main form, and we've troubles maintaining all
their events (along with the events of the various bands).

TIA,
Michael

Comments

  • edited February 2006
    Hi Michael,

    It is possible to completely customize the preview form by creating a
    preview plugin. Using the plugin archetecture, you would be able to
    customize the size of the outline panel to meet your specific needs. Take a
    look at the article below on creating a preview plugin.

    Yes, this would work, however a more graceful solution would be to store
    your entire report definition as a template file (.rtm). With RB
    Enterprise, you are able to store all data access and event code local to
    each report template, then load each template into a single report object in
    your applicatin as you need them.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2006
    Sorry, below is the article...

    -----------------------------------------
    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.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2006
    Nico,

    regarding the topic 'one form for each report':

    I did it some time ago, but that's been rather easy. All reports shared a
    common base, and almost all of the fields were filled directly from the
    database. Now, I've a set of 4 completely different reports, and almost
    all fields are to fill programmatically, approx. 60-70 fields on each
    report.
    I'd to check on each event procedure which report's currently loaded, to
    act correctly on the respective fields.
    Separating reports into several distinct forms (and units) just helps to
    keep track of all events.

    Michael


This discussion has been closed.