SQL Paramter Control With 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
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
This discussion has been closed.
Comments
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
but I don'f fully understand it. I'm hoping it will answer my question, or
move me forward.
/Matthew Jones/
Sorry, my mistake. I misread something.
Tom
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
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