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

how can I fill an autosearch field in RAP

edited October 2002 in End User
Gentlemen

I have a report created with autosearch fields. How can I fill these fields
in RAP, eg, intercept before the form is showed and fill the fields (and
preventing the user from editing it)?

Thanks

Marcos Cunha Lima
Brazil

Comments

  • edited October 2002
    Use the RAP global OnCreate event to set the search expression values. To
    make the search criteria non editable, you'll have to create a custom
    autosearch dialog and control which fields are editable by using a RAP pass
    through function. There are examples of creating a RAP pass through
    function in the RAP demos of the RBuilder installation.

    Your other alternative is to remove the field as an autosearch field and set
    the criteria value on the dataview in code. Here is an example of
    extracting the TdaSQL object to access the search criteria fields. Set the
    field's Autosearch property to false. This way the field won't be used in
    the autosearch dialog, but the criteria value you supply in code will be
    used in the generation of the SQL for the report. Since the autosearch
    fields have already been created, you'll need to free the ones that you are
    going to turn off. There are two sets of objects, the dataviews'
    SearchCritreia objects are persistent in the template as part of the
    dataview. The autosearch fields are created at runtime and are not
    persistent. The autosearch fields are used at runtime (created automatically
    since you have dataviews with search criteria objects) in order to perform
    the search, as shown in the autosearch demos.

    http://www.digital-metaphors.com/tips/ExtractSQLObject.zip


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.