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

Autosearch dialog replacement

edited May 2006 in End User
I've seen the custom dialog demo but what I want to do is for the autosearch
dialog to actually run my own form instead. Is this possible instead. I
presume I would then have to add the autosearch parameters to the report
programatically but I want the report to show my own form instead of the RB
one.

Comments

  • edited May 2006

    The example descends from TppAutoSearchDialog which uses the custom panel
    approach. You can alternatively descend from TppCustomAutoSearchDialog (see
    ppForms.pas). TppCustomAutoSearchDialog descends from TForm and adds a
    couple of abstract properties. Then register your form in the initialization
    section of your form unit

    When you create your form using the Delphi form designer. Modify the class
    declaration

    uses
    ppForms;

    TmyAutoSearchDialog = class(TppCustomAutoSearchDialog)
    end;



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2006
    Thanks but how do I get RB to use my derived dialog then?

  • edited May 2006

    Check out the AutoSearch custom dialog demo. Open the myAsDlg.pas unit,
    scroll to the bottom and find the Initialization section of the unit, it
    contains the registration call for the form. Once you register your custom
    AutoSearchDialog class, then RB will automatically create an instance of
    your custom dialog rather than the default dialog.

    Here is the relevant code from myAsDlg.pas....

    {******************************************************************************
    *
    ** I N I T I A L I Z A T I O N / F I N A L I Z A T I O N
    *
    {******************************************************************************}

    initialization

    ppRegisterForm(TppCustomAutoSearchDialog, TmyAutoSearchDialog);

    finalization

    ppUnRegisterForm(TppCustomAutoSearchDialog);




    Best regards,

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