Thursday, March 22, 2012

AppSettings with Report Designer?

Where do I put appsettings for Report Designer?
It works fine on the Report Server (where I put them in web.config), but I
would like it to work in Visual Studio as well.
I have developed an Data Extension Provider to get data from a Business
tier, instead of directly from a database. The Business tier calls a Data
tier, which needs the connectionstring from appsettings. (I cannot change
this behaviour.)
Regards MaranI solved it.
Put the appsettings in Visual Studio's "devenv.exe.config" and they are read
by the IDE and can be used in Report Designer by the Data Extension.
**********************
"Maran" wrote:
> Where do I put appsettings for Report Designer?
> It works fine on the Report Server (where I put them in web.config), but I
> would like it to work in Visual Studio as well.
> I have developed an Data Extension Provider to get data from a Business
> tier, instead of directly from a database. The Business tier calls a Data
> tier, which needs the connectionstring from appsettings. (I cannot change
> this behaviour.)
> Regards Maran|||A couple of thoughts:
1. Create your own App.config file, or any anyfile.anyfile - place your
config setting there.
Embed that file as a part of assembly.
next -
in your app:
Assembly asm....;
Stream stream = null;
string manifest = null;
foreach(string tmp in asm.GetManifestResourceNames())
{
if(tmp.IndexOf("App.config")>0)
{
manifest = tmp;
break;
}
}
....
stream = asm.GetManifestResourceStream(manifest);
XmlDocument configXml = new XmlDocument();
configXmlReader = new XmlTextReader(stream);
configXml.Load(configXmlReader);
XmlNodeList configNodes = configXml.GetElementsByTagName("appSettings");
....
and so on
2. machine.config is always available.
Oleg Yevteyev,
San Diego, CA
It is OK to contact me with a contracting opportunity.
"myfirstname"001atgmaildotcom.
Replace "myfirstname" with Oleg.
--
"Maran" <Maran@.discussions.microsoft.com> wrote in message
news:13D0CA98-7A7F-4023-B617-2917DC2B0AA3@.microsoft.com...
> Where do I put appsettings for Report Designer?
> It works fine on the Report Server (where I put them in web.config), but I
> would like it to work in Visual Studio as well.
> I have developed an Data Extension Provider to get data from a Business
> tier, instead of directly from a database. The Business tier calls a Data
> tier, which needs the connectionstring from appsettings. (I cannot change
> this behaviour.)
> Regards Maransql

No comments:

Post a Comment