Ops, sorry - wrong question. What I meant to ask was: Lets take that the SQL query I'm talking about is manually edited SQL. Then: Can I somehow pass modified SQL Query (this time programmatically) for execution without modifying the query itself.(So that after I execute programmatically changed SQL modifications made to the manually edited SQL wouldn't be saved into the reports).
You'll have to change the SQL that is in the dataview. What you can do is save the datamodule in code. Then when the template is saved, you could reload the original datamodule. That would be the only way to do it I think. Here is an example of replacing the datamodule at runtime.
Editing the SQL text manually is easy, just extract the SQL object as you have before, and then set EditSQLAsText to true and set the SQLText property. Do this in the Report.Template.OnLoadEnd event.
Comments
What I meant to ask was:
Lets take that the SQL query I'm talking about is manually edited SQL. Then:
Can I somehow pass modified SQL Query (this time programmatically) for
execution without modifying the query itself.(So that after I execute
programmatically changed SQL modifications made to the manually edited SQL
wouldn't be saved into the reports).
Hope it wasn't too confusing.^_^
save the datamodule in code. Then when the template is saved, you could
reload the original datamodule. That would be the only way to do it I think.
Here is an example of replacing the datamodule at runtime.
http://www.digital-metaphors.com/tips/ReplaceDataModule.zip
Editing the SQL text manually is easy, just extract the SQL object as you
have before, and then set EditSQLAsText to true and set the SQLText
property. Do this in the Report.Template.OnLoadEnd event.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com