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

Custom Preview Form

edited June 2006 in General
I was going through the developer's resource PDF and reading the section
that is referred to when you want to customize the preview form, primary the
section quoted below.

"2 Select File | Open from the Delphi main menu. Locate the ppPrvDlg unit in
the RBuilder\Source directory. Open this unit.

3 In the Object Inspector, change the form name from ppPrintPreview to
rbPrintPreview. (You may have to use the drop-down list box at the top of
the Object Inspector to find the ppPrintPreview form).

4 Save the form in the My RB Tutorials directory under the name rbPrvDlg.

5 Select the panel at the top of the form (named pnlPreviewBar)."

When I try doing this, there is nothing on the form specified. Essentially
I wish to add a couple of buttons to the form and change the way that it
handles certain keyboard events (like making page down go to the next page
instead of the bottom of the page).

I can implement these changes by using the ppViewer and a new form, but I
lose the ability to search the report for text.

Am I missing something in customizing the Preview Form, or is there an easy
way to call the search functions present in the default Preview Form?

Thanks in Advance,
Trevor

Comments

  • edited June 2006

    I recommend creating a custom Preview plug-in. The defailt preview plug-in
    is defined in ppPreview.pas and the registration code is at the bottom of
    the unit. The TppPreview plug-in class creates and manages the preview UI
    controls which include the Toolbar, Outline, Viewer and TextSearch. The code
    in that unit is commented and is easy to understand. The preview plug-in is
    used by the report designer Preview page and by the preview dialog.

    Here is downloadable example...

    www.digital-metaphors.com/tips/ShowPageSetupFromPreview.zip




    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.