This is a migrated thread and some comments may be shown as answers.

Accessing AppSettings from within Telerik Reporting Designer

1 Answer 122 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Terry Webster
Top achievements
Rank 1
Terry Webster asked on 20 Jan 2012, 11:22 PM
I have a fax cover page that I have designed for a customer and they have their contact information stored in several appsettings keys.  I can access them at runtime without a problem.  However, in the telerik reporting designer, I cannot preview or html preview them. 

Is there anything special that needs to be done to get this to work in the designer?

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 21 Jan 2012, 11:10 AM
Hello Terry,

Telerik Report Designer operates inside the Visual Studio application. When previewing a report, the project that contains the report is compiled (if needed) and the report class is instantiated through Reflection, and passed to the previewer. This means that the report constructor is executed in the context of the Visual Studio application. As described in MSDN, the ConfigurationManager.AppSettings Property gets the  AppSettingsSection data for the current application's default configuration.
In the case of report designer/preview the current application is devenv.exe so reading the  ConfigurationManager.AppSettings from the report that is previewed will get all app settings defined in the devenv.exe.config file and not the config file of your actual project.

Greetings,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
General Discussions
Asked by
Terry Webster
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or