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

CreateAutoSearchCriteria on FieldAlias

edited May 2004 in RAP
I have datapipeline with two tables Staff1 & Staff2
joined in field StaffNo. How do I call CreateAutoSearchCriteria
on Staff2.Name ?
I tried ppReport.CreateAutoSearchCriteria(aDataPipelineName, 'STAFF2.NAME',
soEqual, 'SomeOne', false) but my expression is still being assigned
on Staff1.Name.

Any clues? thanks !

Comments

  • edited May 2004

    The CreateAutoSearchCriteria method will not work for this case.

    An alternative is to extract the TdaSQL object from the DataView and add the
    search criteria directly to the TdaSQL. Below are a couple of examples. The
    example are in Delphi code. Try implementing a solution in Delphi first,
    then try implementing in RAP as a pass thru function.

    www.digital-metaphors.com/tips/AddSearchCriteria.zip

    www.digital-metaphors.com/tips/ExtractSQLObject.zip

    --------------------------------------------------
    Article: Extending RAP
    ---------------------------------------------------

    There are two very simple and powerful techniques to extend the capabilities
    of RAP infinitely. These are summarized below and covered in more detail in
    the RAP.hlp online help. Demos and tutorials are installed to
    RBuilder\Demos\RAP. The tutorial text is located in RAP.hlp.


    1. RAP Pass-Through Functions

    These are functions that appear in the Language tab of RAP's Code Toolbox.
    These functions are written in Delphi and can be called from RAP. RAP's
    pass-through function architecture enable's developers to add new built-in
    functions to RAP's code toolbox.

    2. Extend RAP's RTTI

    RAP's Run-time Type information defines what classes and properties can be
    accessed via RAP. By default the published properties of any class that is
    registered with Delphi's RegisterClass procedure is recognized by RAP. In
    addition many of the public properties and methods of ReportBuilder classes
    are exposed.







    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com

    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2004
    ok, I'm already doing that. I can see that my criteria
    is actually being added now. However, my report
    does not get refreshed until go to the Query designer,
    clicked ok, before the report actually display the data
    based on the new search criteria. Am I still missing something?

    thanks for your reply.


  • edited May 2004

    You are encountering a timing issue. Most of the events in RAP occur after
    the report engine has already open the datapipelines and initialized them.
    The only events that occur prior to initializing the data are the AutoSearch
    related events such as BeforeAutoSearchDialogCreate and
    OnGetAutoSearchValues. However these events only fire when there is at least
    one AutoSearch field defined.

    Perhaps try defining a dummy autosearch field for the query and then you can
    delete it in the BeforeAutoSearchDialogCreate event.

    You can also use Delphi code attached to the Report.Template.OnLoadEnd event
    to initialize report templates.



    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.