Home RAP

AddAutoSearchWithParam

edited August 2010 in RAP
Hi, using Delphi 6 and RB Enterprise v11.08.

I need to change the autosearch critieria of a report based upon the value
of one of the report parameters. If it is one value, then there is an
autosearch on TableA.FieldA, otherwise the search is on TableB.FieldB. I
need to do this within the RAP, not Delphi.

I discovered the SQLBuilder.SearchCritiera.AddAutoSearchWithParam and
AddParamSearch methods in the Help, but these do not appear to be available
in the RAP.

Is there a way to achieve what I need to do, solely within the confines of
the Report Designer itself?

e.g.
lSQLBuilder := TdaSQLBuilder.Create(Report.Datapipeline);

{Clear the selection criteria}
lSQLBuilder.SearchCriteria.Clear;

if (Report.Parameters['paramOption'] <> '') then
begin
{Add an autosearch on TableA}
lSearch.AddAutoSearchWithParam('TableA', 'FieldA', '=', 'paramB');
end
else
begin
{Add an autosearch on TableB}
lSearch.AddAutoSearchWithParam('TableB', 'FieldB', '=', 'paramB');
end;

lSQLBuilder.ApplyUpdates;
lSQLBuilder.Free;


Thanks,
Jason.
--
Jason Sweby
Software Development Manager,
Carval Computing Limited, Plymouth, UK

Payroll - HR - T&A - Access Control

Comments

  • edited August 2010
    Hi Jason,

    You are correct, RTTI support for the AddAutoSearchWithParam routine is not
    currently implemented. I will add this for the next release of
    ReportBuilder.

    It is possible for you to extend the RTTI for earlier versions of
    ReportBuilder. See the TraTdaSQLCriteriaListRTTI class in the
    daSQLBuilder.pas file.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2010
    OK Nico, thank you very much.

    Jason.

This discussion has been closed.