Store SQL-query in report
Hi,
I want to make a program where users can select different reports to view data in a database. In the different reports are different groupings (one has total hours per month, another hours per project per month and another hours per worker per month).
The groupings only work good when you sort records by the same field as you group them. So I can't use just one dataset for all the different reports, unless you can store the sortingfields or complete query in the report.
I use KaDao-datasets (not the BDE).
I've tried to change or set the query with code in the OnStartReport-event, but you can't access a datasetobject on your delphi-form from within Fast-Report.
Who helps?
I want to make a program where users can select different reports to view data in a database. In the different reports are different groupings (one has total hours per month, another hours per project per month and another hours per worker per month).
The groupings only work good when you sort records by the same field as you group them. So I can't use just one dataset for all the different reports, unless you can store the sortingfields or complete query in the report.
I use KaDao-datasets (not the BDE).
I've tried to change or set the query with code in the OnStartReport-event, but you can't access a datasetobject on your delphi-form from within Fast-Report.
Who helps?
Comments
I would suggest to try the other way around. As I read your question, you want to update the SQL text in a query component on your form, I suppose that is before executing the report.
Why not update the SQL and after that start running the report?
(even een toevoeging: als ik de juiste M. de Reus voor heb, dan bent u klant bij mij en mag u deze vragen per mail sturen. Dan heeft u het antwoord een stuk sneller binnen).
Groeten,
Teo