Hi,
We want to give our users a template report with a lot of prepared DataSources.
The problem is, that while rendering the report every one of these DataSources has its sql statement executed even when the data's aren't used in the report.
Is there a way to restrict execution of the queries to those which are actually used in the report? This would really speed up the report generation.
I experimented a bit with the "Connect on Start" option, but when this option is false, no data at all was fetched.
We use our own Dataadapter derived from StiSqlAdapterService.
Yours sincerely
Damian
Only fetch DataSources which are used
Only fetch DataSources which are used
Hello Damian,
Unfortunately does not exist 100% worked code which can say which datasources is used in report. You can try use method RetrievalData of report dictionary. For example:
This informations can be used for detecting datasources which used in report and which not.
Thank you.
Unfortunately does not exist 100% worked code which can say which datasources is used in report. You can try use method RetrievalData of report dictionary. For example:
Code: Select all
Hashtable usedRelations = new Hashtable();
Hashtable usedDataSources = new Hashtable();
Hashtable usedColumns = new Hashtable();
report.Dictionary.RetrievalData(out usedRelations, out usedDataSources, out usedColumns);
Thank you.
Only fetch DataSources which are used
Hi,
your code would work while generating the report. But now I'm facing the problem, that the preview of the data does not work in all cases. Especially when this datasource is not added to the report.
Fortunately we did found out, that our users will change the SQLs in 95% of all cases.
So we just prefix our statements with <!-- (results in "<!-- Select * from table" ) and the user can optimize/activate the query. In our Adapter we filter out these datasources.
Thank You for your help
your code would work while generating the report. But now I'm facing the problem, that the preview of the data does not work in all cases. Especially when this datasource is not added to the report.
Fortunately we did found out, that our users will change the SQLs in 95% of all cases.
So we just prefix our statements with <!-- (results in "<!-- Select * from table" ) and the user can optimize/activate the query. In our Adapter we filter out these datasources.
Thank You for your help
Only fetch DataSources which are used
Hello,
As i wrote before this way is not work in all cases. I'm glad that you have find way resolve your problem.
Thank you.
As i wrote before this way is not work in all cases. I'm glad that you have find way resolve your problem.
Thank you.