Home End User

Binding Parameters and AutoSearchFields in Code

edited February 2009 in End User
Hi,

I have a parameter that is created during the design of the report. At
runtime, I create a new AutoSearchField using
TppReport.CreateAutoSearchCriteria. How do I bind the Parameter to the
AutoSearchField in code? When adding the Search Criteria using the Query
Designer you have the option to select the Parameter and basically I want to
be able to accomplish the same thing in code so that everytime the parameter
is updated the Search Criteria will automatically be updated as well.

Thanks,
Scott

Comments

  • edited February 2009
    Hi Scott,

    Rather than use the CreateAutoSearchCritera routine, try using the
    TdaSQLBuilder class to create autosearch in code. The new
    TdaSearchCriteriaList.AddAutoSearchWithParam allows you to create new
    autosearch criteria easily and bind it to a parameter that has already been
    created.

    TdaSQLBuilder help can be found in the RBuilder help file and online...

    http://www.digital-metaphors.com/rbWiki/DADE/SQLBuilder

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2009
    Hi Nico,

    That worked great except that it added an extra 15 seconds to the generation
    time of the report. When I created the Search Criteria in the DADE the
    report displayed instantly. However, when I added the Search Criteria in
    code using TdaSearchCriteriaList.AddAutoSearchWithParam. the report took an
    extra 15 seconds to generate. I added breakpoints to isolate the exact line
    of code that is causing the delay and it is the AddAutoSearchWithParam
    method. One thing to note, is that the delay only happens the first time
    the report is executed. If I close the report form, which destroys all the
    components, and re-open it then the report prints almost instantaneous.
    There must be something in the AddAutoSearchWithParam method that is causing
    this huge, and IMO unnecessary, delay. If there is any other information
    that I can provide to assist you in tracking down the information please let
    me know.

    Thanks,
    Scott

    P.S. The TdaSQLBuilder class is awesome!!

This discussion has been closed.