Microsoft ships a ReportViewer control that integrates with SQL Reporting Services to display reports on an ASPX page. There's an older one for SQL 2000 Reporting Services, but specifically I'm dealing with 2005. It's pretty slick. The only challenge is: getting the thing to work without session state.
If you're trying to use the control to run reports in local mode without session state, you're hosed. But that's ok, because most people tend to run them remotely. According to
this doc on MSDN, you can turn off session state IF you embed the connection information in the web.config. To be honest, I don't really know why that is ... in this test case I specify the connection and credentials at run time, but nevertheless, you'll get an exception without this information.
The thing is, the doc is slightly wrong. And since most people will be implementing the IReportServerConnection on a class that's in the APP_CODE folder, setting this up can be tricky. That's where this info comes in handy.
First, the correct key is
ReportViewerServerConnection,
not ReportViewerConnection as specified in the MSDN doc. (You can check by opening up the assembly in Reflector.) It's a minor typo, but obviously critical. So, if you think you've got everything correct but still seeing the same session state error, check the key name. Next, to specify an assembly in the APP_CODE folder, make sure the setting looks like this in the appSettings element of the web.config (the same applies to HttpModules that may reside in the APP_CODE folder):
<add key="ReportViewerServerConnection"
value="Namespace.Classname, APP_CODE" />
That should clear up any problems getting the ReportViewer control to load ... of course, you need to implement that interface in the specified class. Doing this can be tricky depending on the authentication used, so in some future post I'll show some code on implementing the IReportServerCredentials interface.