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

Custom previewer - RB7.01

edited January 2003 in General
I'm having trouble understanding how I can provide my own previewer. I have
followed the example in the Developer's Guide and created a unit rbPrvDlg
which I then 'use'. The resulting TrbPrintPreview form has no components on
it at all for me to customise and when run shows the standard previewer. The
Dev.Guide talks about changing the colour of the panel called
'pnlPreviewBar' - I don't have one? My new TrbPrintPreview form is being
used, because if I drop a TPanel onto it and preview a report, the standard
preview appears but with my added TPanel. However, the previewer displayed
in the report designer (either at Delphi design-time or application
run-time) doesn't have my added panel.

Basically, the functionality of the provided viewer is fine. I would like to
change the way it looks and add some more buttons to provide direct access
to additional functionality, like e-mailing , faxing, etc. I can see how I
can build my own previewer using a TppViewer, but the Dev.Guide suggests the
other method is better.

Any pointers in the right direction will be appreciated.

--
Charles Bainbridge

Comments

  • edited January 2003
    There are two ways of creating a custom preview. The old method of replacing
    the form will still work, however, the currently distributed form is empty
    and the controls are created from a plugin class. To see the old method in
    action, look in the ReportBuilder Tutorials in your installation. Search
    for rbPrvDlg.pas in RBuilder/Tutorials/Complete/II. Applications. The
    problem with this is that only the preview form is replacable, not the
    runtime designer's preview page.

    The new architecture allows you to control both the preview form and the
    designer preview form the same class. ppPreview.pas contains a registry and
    a class that creates the controls at runtime. You should descend from
    TppPreview in order to add more controls or change them at runtime.
    Depending on what you want to do, you can descend from TppCustomPreview as
    TppPreview does, or descend from TppPreview and add some tweaks as you like.

    This tip (RB 7.01 compatible) shows how to add a new button to print the
    current page on the printer.
    http://www.digital-metaphors.com/tips/AddControlsToPreview.zip

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2003
    That's great, I can work with that.

    Thanks.
    --
    Charles

This discussion has been closed.