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

trying to create an AutoSearch Criteria

edited March 2008 in End User
I'm having problems trying to create an AutoSearch Criteria

First off i tried editing the report adding

Report.CreateAutoSearchCriteria('qry_PremiumStatisticsReport', 'AsAtDate',
soEqual, '01/01/2008', True);

inside the ReportBeforeAutoSearchDialogCreate event of the report, and this
created a search field, but created it on a new tab of the AutoSearchDialog,
and this tab was blank (ie had no text on it), whereas i was hoping it would
put it on the qry_PremiumStatisticsReport tab along with the search fields
which had been configured normally.

Next, in Delphi (6) I tried inheriting TppAutoSearchDialog. I overrode the
"Init" procedure and put code in there as follows:

if
(TppReport(report).AutoSearchCriteriaByName('qry_PremiumStatisticsReport','AsAtDate')
= nil) then
TppReport(report).CreateAutoSearchCriteria(
'qry_PremiumStatisticsReport',
'AsAtDate',
soEqual,
'01/01/2008',
False
);

Again, this created the search field on a new tab with a no caption.
Additionally, this would only create the field on the second search, not the
first.

Can you help me out with these issues?

Many thanks

Mark Knockton

Comments

  • edited March 2008
    Hi Mark,

    If you are using DADE for your data access (data tab), I would suggest using
    the TdaSQLBuilder object to add AutoSearch criteria to your queries. If
    not, try using the Report.CreateAutoSearchField routine like in the
    AutoSearch examples located in the \RBuilder\Demos\AutoSearch... directory.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.