Monday, March 26, 2012

How can I programmatically know if RS is installed on a server or not

Hi,,
I have a list of SQL servers available in our network in a ComboBox ,I want
to show a message if there is no reporting service installed on a server of
user choice ,I tried to use listChildern ,,but when there is no RS ,,it
thows an Exception inside the web referenc.
ThanksOne suggestion would be to put the code calling ListChildren inside of
a Try Catch block. If you catch the exception you can display a
message box saying reporting services was not found.
More info on Try Catch can be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconusingtrycatchblocktocatchexceptions.asp
The problem with this approach is you'll have to set the Url property
of the web reference and assume the report server is installed at the
default location (http://machinename/reportserver). If someone
installed the report server at a different location you'll need a more
robust mechanism to find it. I'd suggest trying WMI (windows
management instrumentation). There is an example in the docs showing
how to connect to a remote report server:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_prog_wmi_6iua.asp
Note: the sample code in the docs also needs a try / catch in case the
server does not have SSRS installed.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 12 Nov 2004 11:25:32 -0800, "ALI-R" <newbie@.microsoft.com>
wrote:
>Hi,,
>I have a list of SQL servers available in our network in a ComboBox ,I want
>to show a message if there is no reporting service installed on a server of
>user choice ,I tried to use listChildern ,,but when there is no RS ,,it
>thows an Exception inside the web referenc.
>Thanks
>

No comments:

Post a Comment