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

OnGetAutoSearchValues event

edited September 2003 in RAP
Is it possible to force the OnGetAutoSearchValues event to fire more than
once?

You might wonder why so I'll explain. Maybe you can suggest a better way
altogether.

My app has hundreds of reports and I have thousands of users of it all of
whom customise the reports to suit their needs.
Therefore I have very few data pipleines on my forms - I prefer to build the
dataviews entirely in the report for maximum customisation flexibility.

However in some cases I resort to a pipeline on the form where the options
are just too complicated to put in the report. But where the customer then
wants extra fields etc on the report I tried setting up detail queries on
the Data page with Autosearch fields on the key fields and then setting the
values of the key fields in OnGetAutoSearchValues event using the values
from the pipleline on the form. I used to use a similar approach in QRDesign
(I know you must hate it when people say that!)

In QRDesign I could link Datasets on my forms to Datasets created in the
report files therefore no need to manually set the key values.

The problem in RB is that OnGetAutoSearchValues fires once and so the key
values are not reset as the main pipleline is traversed.

So I need a way of either forcing the event to refire or a way of linking
Dataviews in the report to the pipelines on the form.
Or some other way of getting the dataviews to pick up the current key value
for the record the pipeline is on and refresh the dataview.

Does this make sense?

Hope you can help.

Regards
Rhonda Ridge

Comments

  • edited September 2003
    Hi Rhonda,

    The way which Delphi links queries is very slow. There is an alternative in
    which you don't need the firing of the OnGetAutosearchValues event more than
    once. What you will want to do is create a single detail dataset that
    includes all detail records for all master records in the order of the
    master's ORDER BY. This way the report engine can simply traverse the detail
    dataset and the report engine is smart enough to break master and have
    subreports generate correctly for each master. This way you can use one
    autosearch event to filter the master and detail queries. In order to tell
    the report engine that it should evaluate the detail dataset this way,
    you'll have to set the detail datapipeline's MasterDataPipeline and
    MasterFieldLinks properties. Here is an example:
    http://www.digital-metaphors.com/tips/MagicMasterDetail.zip

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2003
    Hi Jim,
    Thanks for the reply. However this solution is fine where you can have both
    the TQueries and Data Pipelines on the form. However what I am looking for
    is a solution that allows me to link a detail dataview created in the report
    designer to a master query on the form. I want to be able to do this is in
    RAP
    in the report itself not by code on the form

    My understanding is that I have no access to the events and properties of
    datapipelines that exist as dataviews in the report via RAP code.

    Is there anyway this can be done?

  • edited September 2003
    Hi Rhonda,

    You can link a DADE pipeline to a form/datamodule based pipeline. Here are
    two examples of this:
    http://www.digital-metaphors.com/tips/LinkDADEPipeToStandardPipe.zip
    http://www.digital-metaphors.com/tips/LinkStandardPipeToDADEPipe.zip

    To do this from RAP, you'll have to code some pass through functions to link
    these pipelines. There are examples of creating RAP pass through functions
    in the RAP tutorials and demos of the installation.

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.