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

Manipulating Autosearch

edited January 2005 in End User
I have a report designed through the end user solution. I have multiple
queries designed, all of which need to run off of a single date the is input
by the user. I have tried just adding one autosearch criteria at design
time and then creating the other autosearch based off of what was input into
the original but creating the autosearch criteria in the
OnGetAutosearchValues doesn't seem to do the trick. I don't know what else
to do / try. Any help would be greatly appreciated!!!

Thank All,
Branden Johnson

Comments

  • edited January 2005
    Hi Branden,

    If you are trying to manipulate the AutoSearch criteria in RAP, you will
    need to create a passthru function that does so and call that from the
    OnGetAutoSearchValues event. Not too long ago I created an example that
    does just that. It should get you on the right track for your own
    application.

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

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2005
    I have modified the example you sent me. I added a second customer query
    and a subreport onto the detail linked to this new customer query. I
    modified the ChangeAutosearch to except the fieldname and operator. I have
    also modified the method call in the report calculations to pass the value
    entered into the first autosearch that appeared when the report is initially
    run. I want to be able to add an autosearch to the second query on the same
    field!!! If you run the example I have provided you will see that it does
    all that I want it to except that it adds the search criteria to the first
    query. I need to know how to specify which query the autoseach will be
    added to!!!

    Thank You Nico,
    Branden Johnson
  • edited January 2005
    Oops!!!
    Attached is the example...

  • edited January 2005
    I realized that the problem was in the GetSQLObject. The line lDataView :=
    lDataModule.DataViews[0]; was hardcoding that the sql object that would be
    reutrned would always be the first query created for the report. I
    hardcoded lDataView := lDataModule.DataViews[1]; to check and make sure that
    it would work to use this to add an autosearchcriteria to the second query.
    It did change the second query but I am now back to my original problem that
    if you add autosearch criteria at this point to a query that did not already
    have autosearchcriteria when the report was generated, it doesn't pick up
    the change in the report!!! Is there any procedure that I can call to
    refresh the queries/dataviews?

  • edited January 2005
    Never Mind!!!

    I realized that the SetSQLObject line lDataView := lDataModule.DataViews[1];
    was also hardcoded and now my problem is solved.

    Thank You,
    Branden Johnson
This discussion has been closed.