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

clearing search criteria

edited November 2007 in General
I have a report with a subreport and 2 queries in the datapipeline. I need
to clear all of the search criteria and write my own search criteria at
runtime. I do not need to change entire sql, just search criteria.

I have looked at help extensively and I can use the following code. The
problem is that it only clears the first query of the pipline and not the
second. Basically I need to know what functions to call to clear all search
criteria (including begin / end /or) and what function to use to rewrite the
same.

Currently using:
lSQLBuilder := TdaSQLBuilder.Create(ppReport1.DataPipeline);
lSQLBuilder.SearchCriteria.Clear;
lSQLBuilder.SearchCriteria.AddAutoSearch('Journals', 'Account', '=',
editAccount.Text);
lSQLBuilder.ApplyUpdates;

This only clears search criteria of the first, not second. I must be able
to clear search criteria of both queries and must clear begins, ends, and
Or.

Thanks for your help.

Comments

  • edited November 2007
    > lSQLBuilder := TdaSQLBuilder.Create(ppReport1.DataPipeline);

    Well, I don't use the TdaSQLBuilder, but if your code is correct, the
    following should work for the detail dataview:

    lSQLBuilder := TdaSQLBuilder.Create(ppSubReport1.DataPipeline)

    HTH,
    Edward Dressel
    Team DM
  • edited November 2007
    Please tell me how you do this because I really need more flexibility such
    as ability to evaluate the filters, etc. Perhaps you can post sample code?

    Thanks,
    Bob

  • edited November 2007
    Hi Bob,

    Ed is correct, there can only be one query (dataset) per datapipeline in
    ReportBuilder. If you need to clear two separate queries (each connected to
    their own pipeline) you will need to create two TdaSQLBuilder objects. Note
    that Ed's example creates a new TdaSQLBuilder for the pipeline connected to
    a subreport which would be one way of accessing a second pipeline.

    --
    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.