Solved

Reportingservices 401 and 404

Posted on 2013-01-15
10
485 Views
Last Modified: 2013-03-04
Please help before my hair turns grey!
Environment server2008R2 IIS 7.5 SQLexpress2005
Application runs in classic mode

Services run under the network service account.

Reports run as the should in browser, but when running rs.exe from command line all I'm getting is HTTP401 and 404
0
Comment
Question by:Everlas
  • 5
  • 4
10 Comments
 
LVL 37

Expert Comment

by:ValentinoV
ID: 38778085
How are you running rs.exe?  Does the account with which you're logged in have admin rights on the report server?  Also, did you open the command prompt "as administrator"?
0
 

Author Comment

by:Everlas
ID: 38778316
I'm starting the command prompt as administrator - the same user as logged in at the server.
I think the administrator has almost any rights.

My command looks like this:

C:\Users\Administrator>

rs -i C:\Rapport\CreatePDF.rss -s http://Localhost/ReportServer$SQLExpress -e Exec2005 -v FileName=""C:\Rapport\test.pdf"" -v reportPath=""/test""
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 38778416
Using that same user, are you able to do it manually? (through Report Manager)

With run "as administrator" I didn't only mean to log with an admin account but also to open the command prompt with elevated permissions.  That's done by right-clicking the shortcut and selecting "Run as administrator".  On some OSes, such as Windows Server 2008 R2, this is needed even with an admin account.

Also, are you sure that the endpoint (Exec2005) is the right one to use here? (without seeing the CreatePDF.rss file I can't really judge this)
It just seems more logical to use one of the management endpoints in this context.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:Everlas
ID: 38778521
What do you mean by report manager?

Yes, elevated permissions.

The rrs file looks like this with very little information as the parameter are given in the command.

    'Dim format as string = "Excel"
    Dim format As String = "PDF"

    Public Sub Main()

        ' Prepare Render arguments
        Dim historyID As String = Nothing
        Dim deviceInfo As String = Nothing
        Dim showHide As String = Nothing
        Dim results() As Byte
        Dim encoding As String = Nothing
        'Dim mimeType as string = "ms-excel"
        'Dim extension as string = "xls"
        Dim mimeType As String = "application/pdf"
        Dim extension As String = "pdf"
        Dim warnings() As Warning = Nothing
        Dim reportHistoryParameters() As ParameterValue = Nothing
        Dim streamIDs() As String = Nothing
        Dim rs As New ReportExecutionService
        rs.Credentials = System.Net.CredentialCache.DefaultCredentials

        Dim parameters(0) As ParameterValue
        parameters(0) = New ParameterValue()
         'parameters(0).Name = "Area"
         'parameters(0).Value = AreaPara
        'parameters(1) = New ParameterValue()
        'parameters(1).Name = "StopDate"
        'parameters(1).Value = StopDatePara
        'parameters(2) = New ParameterValue()
        'parameters(2).Name = "ReportName"
        'parameters(2).Value = FileNamePara
        Dim execHeader As New ExecutionHeader()
        Dim rpt As New ExecutionInfo
        rpt = rs.LoadReport(reportPath, Nothing)
        rs.SetExecutionParameters(parameters, "da-dk")
        rs.ExecutionHeaderValue = execHeader
        rs.ExecutionHeaderValue.ExecutionID = rpt.ExecutionID
        results = rs.Render(format, deviceInfo, extension, mimeType, encoding, warnings, streamIDs)

        ' Open a file stream and write out the report
        Dim stream As FileStream = File.OpenWrite(fileName)
        stream.Write(results, 0, results.Length)
        stream.Close()

    End Sub
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 38778621
Ow okay, you're rendering to PDF!  In that case it's indeed the right endpoint to use.  (I was under the impression you were uploading a PDF to the server.)

Report Manager is the management interface (website) that ships with reporting services.  In your case you can probably access it through the following URL: http://localhost/reports_SQLExpress

BTW: is the URL to your report server working fine? (the one you've mentioned in your first comment: http://Localhost/ReportServer$SQLExpress)
You can test that by using Internet Explorer to open it.  With sufficient privileges you should be able to render the existing reports.
0
 

Author Comment

by:Everlas
ID: 38778633
It works perfectly in the browser.
0
 
LVL 10

Expert Comment

by:Monica P
ID: 38813274
Check once the URL assigned in your code in webservice URL

 ' Assign the URL of the Web service and not ReportManager URL
        rs.Url = "https://www.tttt.com/reports/ReportService.asmx"
0
 

Accepted Solution

by:
Everlas earned 0 total points
ID: 38875471
The following line in the rss file had to be removed:
Dim rs As New ReportExecutionService
0
 
LVL 37

Assisted Solution

by:ValentinoV
ValentinoV earned 500 total points
ID: 38881507
Wow yeah, I surely missed that line!  As you've discovered, it's not a good idea to re-instantiate the RS object.  It gets created automatically by the RS Utility.

The script environment automatically connects to the report server, creates the Web proxy class, and generates a reference variable (rs) to the Web service proxy object.
(ref. Format a Reporting Services Script File)
0
 

Author Closing Comment

by:Everlas
ID: 38949228
Plain answer
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question