When I run a sql stament from a ppReport, I would like to know where the report saves the sql strings so i can add parameters to it from inside the very ppreport. I mean not passing parameters from delphi, but from inside the ppreport component itself.
The Report has a datamodule that you can extract to get at the dataview objects at runtime. From there, you have two options, edit the SQL text or manipulate the criteria objects in the dataview. The two options differ in that the first will disable any future ability to edit the dataview through the query designer other than editing the SQL text. The second option lets you define criteria on the dataview just as DADE manipulates the query. The latter will allow you to be able to change the query without losing the query designer functionality if you decide to edit the dataview at a later time. Here is an example which extracts the TdaSQL object from the dataview and adds criteria fields to it using the second approach.
If you want to edit the SQL text instead, you'll have to extract the SQL object and set the EditSQLAsText property of the TdaSQL object to true and then set the SQLText TStrings property.
Comments
objects at runtime. From there, you have two options, edit the SQL text or
manipulate the criteria objects in the dataview. The two options differ in
that the first will disable any future ability to edit the dataview through
the query designer other than editing the SQL text. The second option lets
you define criteria on the dataview just as DADE manipulates the query. The
latter will allow you to be able to change the query without losing the
query designer functionality if you decide to edit the dataview at a later
time. Here is an example which extracts the TdaSQL object from the dataview
and adds criteria fields to it using the second approach.
http://www.digital-metaphors.com/tips/ExtractSQLObject.zip
If you want to edit the SQL text instead, you'll have to extract the SQL
object and set the EditSQLAsText property of the TdaSQL object to true and
then set the SQLText TStrings property.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com