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

SQL Paramter Control With RAP

edited May 2004 in RAP
I need to create the capability for end-user input of SQL query parameters
when the SQL has been manually modified.

The approach has to be generalized so that the end-user can accomplish this
completely in RAP Code for any reports he creates.

I found an example of a passthrough function for InputBox which solves the
problem of inputing the parameters but I am not sure how to get from that to
the RAP code needed to actually insert them in the SQL. My assumption is
that these actions should occur in the OnCreate event of the report.

I see bits and peices of the solution but can't seem to get the entire
process straight. An outline of the steps (and hopefuly, examples) that are
needed would be very much appreciated.

Regards,
Tom

Comments

  • edited May 2004

    Below is a link to an example that demonstrates manually specifying the SQL
    Text and supporting AutoSearch. This example is implemented in Delphi code.
    To implement in RAP code would require pass that you define one or more
    pass-thru functions.

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



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


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2004

  • edited May 2004
    The code in TForm1.ppReport1GetAutoSearchValues appears to be changing it,
    but I don'f fully understand it. I'm hoping it will answer my question, or
    move me forward.

    /Matthew Jones/
  • edited May 2004
    >


    Sorry, my mistake. I misread something.

    Tom
  • edited May 2004

    When I run the example, the Report.OnGetAutoSearch values fires and the
    SQLText is modified so that a new Where clause is added to reflect the
    AutoSearchField value.

    Note that this example is compiled with RAP linked into the example. When
    RAP is present the current state of the report is saved prior to pressing
    Preview. When leaving Preview, the original state of the report is restored.
    Thus if you return to the Data workspace, the original query is intact.



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2004

    Okay, I responded to your post above, I did not see this one till now...

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

    Best regards,

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