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

Create Autosearch in code and Manually-entered SQL? Is is possible?

edited May 2008 in General
It is possible to have autosearch fields (created in code) in combination
with manually-entered SQL queries?
The report uses a manually entered SQL (because it uses join with
sub-queries io. tables).
I use the function tppReport.CreateAutoSearchCriteria()
It creates an autosearch field but the value in it does not influence the
query!

How can I influence a manually-entered SQL?

Many thanks,
Wim

MC Wim

--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited May 2008
    Hi Wim,

    Once you choose to edit the SQL manually in DADE, ReportBuilder simply sends
    the SQL code as is to the database to be processed. It is possible to still
    add and use the AutoSearch feature however you now need to manually enter
    the desired autosearch values before the SQL is sent. Take a look at the
    following example on how this can be done.

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


    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2008
    Hi Nico,
    There is no problem that I have to write code for this, I am glad it is
    possible and will have a look at the example you sent tomorrow and see if
    I can get it to work.

    Thanks,
    Wim Smit
    Magna Carta


    MC Wim

    --- posted by geoForum on http://delphi.newswhat.com
  • edited May 2008
    Nico,
    I am trying to implement the coded autosearch but I get not get it to
    work. Probably it has something to do with what was in the memo on the
    demo program:
    Examine that the RAP event handler for the OnCreate
    event has the call to the pass thru function to create
    the autosearch field.

    Where can I find that handler? Do I have to set it in the Report Designer
    or in code or should it be automatic, because of the unit PassThruFunctions???
    I am looking on the Calc tab, the Report Objecten, but I don't see an
    OnCreate. Or any ON.. handler. I am using RB 10.03.

    Thanx,
    Wim


    MC Wim

    --- posted by geoForum on http://delphi.newswhat.com
  • edited May 2008
    Hi Wim,

    If you open the PassThruFunctions.pas file you will see where the pass thru
    functions are defined and registered (in the initialization section). The
    Execute Function represents the actual code that is executed when the pass
    thru function is called from RAP at runtime. Take a look at the PassThru
    examples in the Developer's guide and the RAP demo located in the
    \RBuilder\Demos\0. RAP\... directory for examples and instructions on
    creating and using PassThru functions.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2008
    Nico,

    I have managed to get that AUTOSEARCH category in RAP, somehow!
    The Register function ARE called in PassThruFunctions.pas but NOT the
    procedure TdmCreateAutoSearchField.ExecuteFunction(aParams: TraParamList);

    So our code (to add autosearchfields) is not called.

    How is this TdmCreateAutoSearchField.ExecuteFunction registered? How can
    the one in PassThruFunctions.pas get called??

    Regards,

    Wim


    Wim
    PassThruFunctions???
    sends
    still

    MC Wim

    --- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.