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
inc:\Program Files\Microsoft SQLand Event Viewer – there’s nothing there.)
Server\MSSQL.4\Reporting
Services\LogFiles
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:
I moved
appSettingsto thec:\Program Files\Microsoft SQLfileServer\MSSQL.4\Reporting
Services\ReportServer\web.config
(all attempts to access
ReportManager\Web.configfailed).I replaced the
System.Webreference with
System.Configuration,.Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
I used
System.Configuration.ConfigurationManager.AppSettings("SomeKey")to read the value.