I am setting image URL as follows.
It is working fine when I am running application. I am able to see image in browser. If I am trying to preview report through designer Tab, It is saying "The given key was not present in the dictionary."
My Appsetting section:
Please suggest how I can make working in preview mode too.
pictureBox1.Value = System.Configuration.ConfigurationSettings.AppSettings[
"ImageFolderURL"
] +
"apple_ex.png"
;
My Appsetting section:
<
appSettings
>
<
add
key
=
"ImageFolderURL"
value
=
"http://www.queness.com/resources/images/png/"
/>
</
appSettings
>
6 Answers, 1 is accepted
0
Squall
Top achievements
Rank 1
answered on 05 Mar 2012, 10:04 AM
Hi,
When you are previewing report in report designer the used configuration file is the one in the class library where you keep the reports.
Try to add the app settings configuration in the class library app.config.
SN
When you are previewing report in report designer the used configuration file is the one in the class library where you keep the reports.
Try to add the app settings configuration in the class library app.config.
SN
0
Manoj
Top achievements
Rank 1
answered on 06 Mar 2012, 10:32 PM
appSettings
are also included in app.config.0
Accepted
Hello Manoj,
Squall is right that when previewing the report, the configuration file used is not the one in your application, however it is not the app.config of the class library either. 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.
Kind regards,
Steve
the Telerik team
Squall is right that when previewing the report, the configuration file used is not the one in your application, however it is not the app.config of the class library either. 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.
Kind regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Manoj
Top achievements
Rank 1
answered on 09 Mar 2012, 07:17 PM
Then, how is it reading connection string from appsettings without defining in devenv.exe.config .
0
Hello Manoj,
We apply special logic to our data source components, so they read/write from the app.config of the class library in design time.
All the best,
Steve
the Telerik team
We apply special logic to our data source components, so they read/write from the app.config of the class library in design time.
All the best,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Manoj
Top achievements
Rank 1
answered on 12 Mar 2012, 06:20 PM
Oh, I got it. Thanks.