Home Server

Where's the beef?

edited November 2003 in Server
Actually I'm looking for the CreateAutoSearchField method. I have been using
it with TppReport compenents, but can't find it or a replacement for a
TrsClientReport component. How should I go about adding custom
AutoSearchFields?
Thanks,

Warren

Comments

  • edited November 2003

    AutoSearch works a little differently in a server environment. Custom search
    fields need to be added by code that executes on the server side. The
    Report.BeforeAutoSearchDialogCreate and OnGetAutoSearchValues events are
    supported for server based reports.

    The ClientReport retrieves the search parameters from the server, shows the
    dialog and then sends the search values entered by the user back to the
    server where they are used to generated the report.





    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2003
    Ok, I found that I can access the TppReport component through the
    aEventParams that are passed to the ReportVolume, which gives me access to
    CreateAutosearchCriteria and Create AutoSearchFields. Only questions now is
    which ReportVolume event is best to use to use to Add my AutoSearch Fields.
    It will be a hidden feied that the end-user does not need acces to. I
    currently have the code in the OnGetReportParams event. Is this the best
    place or is ther another event that would be better?
    Thanks,

    Warren

  • edited November 2003

    Rather than use the ReportVolume events, try using the
    Report.BeforeAutoSearchDialogCreate event.



    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2003
    I don't see any Report.BeforeAutoSearchDialogCreate event anywhere on Client
    or Server side. Where is it?

    Warren

  • edited November 2003
    My response to the BeforeAutoSearchDialogCreate event question appears
    below.

    I reread your original question. And my question is how have you been using
    CreateAutoSearchFields in your non server based reports. Perhaps if I
    understand that better, we can more efficiently work towards implementing a
    similar solution for the server environemnt. Are the reports form-based,
    .rtm based, or stored in a database?

    As described below you can use the ReportVolume.LoadReportEnd event to
    initialize the report. That might be the place to add the AutoSearchFields.
    The ClientReport will display the autosearch dialog by default, so you will
    need to suppress it by using the ClientReport.OnReceiveAutoSearchFields
    event to set ClientReport.ShowAutoSearchDialog to False.

    ---

    The TppReport.BeforeAutoSearchDialogCreate event is an event associated with
    the TppReport component. This event is available in all versions of RB, it
    is not specific to the server.

    To use this event in a server environment, you could implement the event in
    RAP code - in which case the code is saved with the report definition. You
    could implement the event in a form based reports. Or you can use the
    ReportVolume.OnLoadEnd event to assign the event-handler programmatically.
    The Sender of the OnLoadEnd event is the TppReport object.

    example:

    procedure TmyDataModule.rsReportTemplateVolume1LoadReportEnd(Sender:
    TObject);
    var
    lReport: TppReport;
    begin
    lReport := TppReport(Sender);

    {create autosearch fields here or attached the
    BeforeAutoSearchDialogCreate event handler}


    end;

    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

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