Adding a line to the SQL
I need to add a line to the bottom of the SQL for one of my reports (it is DBISAM and the report needs NOJOINOPTIMIZE adding to make it work in an acceptable time).
I have tried creating a pass-through function, which adds this to the end, but I can't get it to run at the right time. If I put it on the report beforeprint event, it fires after the SQL has been run through the database.
I'm also using autosearch fields, and while it seems these two are not compatible, if I can work out how to do one, I can do the other in code as well.
I know I could do this OK if the reports were designed at design time, but I need everything to be in the report as they are stored in a database (as per the demo end-user application, which I used as a base).
Any help appreciated.
Jeremy Knowles
I have tried creating a pass-through function, which adds this to the end, but I can't get it to run at the right time. If I put it on the report beforeprint event, it fires after the SQL has been run through the database.
I'm also using autosearch fields, and while it seems these two are not compatible, if I can work out how to do one, I can do the other in code as well.
I know I could do this OK if the reports were designed at design time, but I need everything to be in the report as they are stored in a database (as per the demo end-user application, which I used as a base).
Any help appreciated.
Jeremy Knowles
This discussion has been closed.
Comments
to edit the SQL text and use autosearch. To do this, you'll really need to
use a manual way to apply the autosearch criteria values and also edit the
SQL text at the same time. For an example of editing the SQL text in a
dataview and then using autosearch, here is an example to start with. This
is the way you will be able to have persistent dataviews that you can edit
at runtime and still use autosearch criteria.
http://www.digital-metaphors.com/tips/EditSQLAndSearch.zip
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Thanks for the help, I see what it is doing. I have one problem with it though. I am using DBISAM, and it keeps stopping!
After the point where the WHERE is removed (the next time it tries to delete the next line), the routine TdaDBISAMDataSet.GetFieldsForSQL in daDBISAM crashes because the WHERE is now missing from the SQL statement.
How can I stop it calling this routine?
Regards
Jeremy