Hi friends
I have .net app ,where i display reports from my report server in a screen .,which works fine.
I added a web reference to my report server ,to my solution to get it work.
since i know my report
server name on machine i added webreference to my project. but when i deploy
at site ,as you can guess, the server name can be different.
is it possible add web reference programmaically so that i dont need to hard code report server name
am using sql server standard 2005,VS2005 standard edition.
Thank you very much for your help

accessing report server programmatically
maclessi
if i understood you correctly, i just need to add a web reference to one of in-house report servers ,to our solution but when using it at client sites i need update "URL" property of the web service object by reading either from a config file or from a database field.
is this correct
Thanks for your help
PIEBALD
You can use the following in your web.config:
<appSettings>
<add key="ServerURL" value=http://someServer/path/method.aspx />
</appSettings>
And in your code:
reportService.Url = ConfigurationSettings.AppSettings["ServerURL"];
panagorafredrik
Stephen Hauck
NicksterFL
in the place where you instantiate the webservice client:
MyReportServer rs = new MyReportServer();
rs.Url = "http://myservername/reportserver/blabla.asmx";
Pete Loveall
its a windows app and i dont have a web.config.
Martin McNally
When you add a web reference VS will add a C# file to your project with web service endpoint definition. Then in some place in your program you make a call to the web service. the web service will be represented by an object. I refered to the type of the object MyReportServer, mostlikely it will be called differently in your app. This object has Url property that you may assign any new report server URL you want. Just find the place where the object is created.
By default, "MyReportServer" class pulls webservice URL from your config file. You can reset it by assigning new url via Url property
rpesq
i already tried and it works nicely.
Thank you very much for your help :)
VBnerd
i cant find "MyReportServer" namespace!
what library i need to give reference to
Thanks for your help
Abu S. Md. Ismail
>> if i understood you correctly
yes.