views:

42

answers:

1

Hi all
I want to upload report files via c# application to the report manager.(mean Like simple Upload, select a report file and then upload selected file into report manager).
I use this sample and when i upload file an exception occurred the remote server returned an error: (401) unauthorized
** my code **

WebClient webclient = new WebClient();
webclient.UploadFile("http://server-report/Reports/Pages/", Source);

-> source refer to selected file path.
so if walking in right wayso how resolve that exception or If i not so guide me to right way?

+2  A: 

you might have to use the Reporting Services Web Service to perform such operations.

have a look at – Accessing the Reporting Services Web Service Using

http://msdn.microsoft.com/en-us/library/aa237438%28SQL.80%29.aspx

Edit Add a web reference to SSRS web services e.g. http://yourserver/reportservice/ReportService2005.asmx

your code will be something like

ReportingService2005.ReportingService2005 service = new ReportingService2005.ReportingService2005();

    service.CreateReport("your report","parent folder",true,<rdl byte array>,<rdl properties byte array>)

Edit 2 To add web reference through Visual Studio

1) Right click on your project

2) select "add web reference" option

3) enter the webservice url

for SSRS 2008 the webservice url is the same as mentioned above

ajay_whiz
i need a sample mean code-snip
Rev
@Rev see the edit
ajay_whiz
@Ajay I have two problem `1: how add reporting service refrence ` and `2: I work with reporting 2008`thx Rev
Rev
@Rev please see edit 2
ajay_whiz
@Ajay I must say this work on dot-net2. In dot-net 3 an higher there is no Web Reference. so this is not problem i change my Dot-net application version to 2 and use web reference but after cheking for this service i see this error:`The web application you are attempting to access on this web server is currently unavailable ` so is this step to forward?
Rev
ajay_whiz
@Rev Try opening the SSRS webservice in a browser it should give you some XML data. If thats happening then try to add web reference. you cal also try appending "?wsdl" in you URL e.g. http://yourserver/reportservice/ReportService2005.asmx?wsdl
ajay_whiz
I think about diffrent problem.may be I haven't this service.(but is this posible I have reportingmanager and reportbuilder). so when I try find that service in browser i see this page `The web application you are attempting to access on this web server is currently unavailable`
Rev
@Rev You can check your SSRS configuration by opening Reporting Services Configuration Manager
ajay_whiz