I have noticed that I often use date parameters in my reports, and that I often set these to a default value at report runtime. In my experience, using a SQL statment such as GETDATE() seems a bit slower than you would think (probably because of the round trip to the SQL server).
To resolve this, you can use the Non-Queried option for setting defaults and use code such as:Just type that into the textbox next to the Non-Queried radio button on the Report Parameters form if you want the default date to be today. You can use a modified version of the above for different date ranges such asCode:=System.DateTime.Today()instead of Select GETDATE()-7.Code:System.DateTime.Today.AddDays(-7)
Many of my reports run much faster without the excess need to query the SQL server for these default values. Of course this only works if your dates are not dependant on data in the table(s) you are querying in the report.
Happy Reporting![]()



LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks