views:

65

answers:

1

I want to read an appSettings value from the c:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportManager\Web.config file and display it in a report.

I added a reference to System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a and set field Value property to
System.Web.Configuration.WebConfigurationManager.AppSettings("SomeKey").

All I got is an ultra-useful #Error message.


I found the Can you reference appSettings in an SSRS report? question, but I'd like to avoid creating a custom assembly if possible (after all, what I want to do, requires no custom logic).


Bonus question:

  • How can I troubleshoot this problem? Where can I find more detailed information about error that occured? (I checked the files in c:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\LogFiles and Event Viewer - there's nothing there.)
+1  A: 

I managed to make it work (with the help of this article)!
It turned out that I was doing everything almost right from the beginning - I only had to change small details:

  1. I moved appSettings to the c:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\web.config file (all attempts to access ReportManager\Web.config failed).

  2. I replaced the System.Web reference with System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

  3. I used System.Configuration.ConfigurationManager.AppSettings("SomeKey") to read the value.

Marek Grzenkowicz