Click here to Skip to main content
15,890,882 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionConverting Word document to HTML page Pin
meeram393-Sep-14 19:14
professionalmeeram393-Sep-14 19:14 
SuggestionRe: Converting Word document to HTML page Pin
Kornfeld Eliyahu Peter3-Sep-14 20:14
professionalKornfeld Eliyahu Peter3-Sep-14 20:14 
QuestionEncoding password sent to MVC web service reports vulnerability issues Pin
Stephen Holdorf3-Sep-14 8:22
Stephen Holdorf3-Sep-14 8:22 
QuestionAjax call Error when using FileStream in code Pin
pawan Jha19883-Sep-14 2:59
pawan Jha19883-Sep-14 2:59 
AnswerRe: Ajax call Error when using FileStream in code Pin
Richard Deeming3-Sep-14 3:32
mveRichard Deeming3-Sep-14 3:32 
GeneralRe: Ajax call Error when using FileStream in code Pin
ZurdoDev3-Sep-14 3:36
professionalZurdoDev3-Sep-14 3:36 
GeneralRe: Ajax call Error when using FileStream in code Pin
pawan Jha19884-Sep-14 0:54
pawan Jha19884-Sep-14 0:54 
QuestionThe request failed with HTTP status 401: Unauthorized Pin
Member 101656822-Sep-14 2:38
Member 101656822-Sep-14 2:38 
I trying get ssrs 2008 up and running on a new server.

I got everything to work just like it dit on my old server and I can deploy reports and view them in the report manager, but I cannot seem to view a report from asp.net applications either in a reportviewer or using the reportexecutionservice. I keep getting the error: The request failed with HTTP status 401: Unauthorized

This is the first time that I had to set up ssrs so I do not know whether I have missed something. I tried to make everything the same as the instance on my old server.
Any assistance would be appreciated.

The following code is what I use for the web execution service and it used to work fine.

This code basically just renders the report as a pdf and downloads it.

rs.Credentials = New System.Net.NetworkCredential("username", "password", "domainname")
Dim reportPath As String = "/OLS/" & ReportName
Dim ResultStream() As Byte
Dim StreamIdentifiers() As String = Nothing
Dim optionalParams(1) As ParameterValue
Dim OptionalParam As String = Nothing
Dim optionalWarnings As WebReference.Warning() = Nothing
optionalParams(0) = New WebReference.ParameterValue
optionalParams(0).Name = "WarningID"




optionalParams(0).Value = Session("ID")
' Create and set the content type string
Dim contentType As String = "application/pdf"
Dim historyID As String = Nothing
Dim devInfo As String = "<deviceinfo><toolbar>False"
Dim format As String = "PDF"
Dim extension As String = ""
Dim encoding As String = ""
Dim mimeType As String = ""
Dim warnings As Warning() = Nothing
Dim streamIDs As String() = Nothing

Dim WarningID As String
WarningID = Session("ID")


Dim execInfo As New ExecutionInfo
Dim execHeader As New ExecutionHeader()
rs.ExecutionHeaderValue = execHeader
execInfo = rs.LoadReport(reportPath, historyID)
rs.SetExecutionParameters(optionalParams, "en-us")
Dim FilePath As String
FilePath = "c:\WebDocuments\OLS\TempDocs\" & Session("EmployeeID") & "\"

Try
ResultStream = rs.Render(format, devInfo, extension, encoding, mimeType, warnings, streamIDs)

execInfo = rs.GetExecutionInfo()

Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime)


Catch err As SoapException
'Console.WriteLine(e.Detail.OuterXml)
End Try

' Write the contents of the report to an MHTML file.
Try
Dim stream As FileStream = File.Create(FilePath + WarningID + ".pdf", ResultStream.Length)
Console.WriteLine("File created.")
stream.Write(ResultStream, 0, ResultStream.Length)
Console.WriteLine("Result written to the file.")
stream.Close()
Catch err As Exception
Console.WriteLine(err.Message)
End Try

'insertDownload(ClientID)
'Response.Redirect(Request.Url.ToString)

' ResultStream = rs.Render("/" & sReportPath & "/" & sReportName, "PDF", Nothing, "<deviceinfo><streamroot>/RSWebServiceXS/", optionalParams, Nothing, Nothing, OptionalParam, OptionalParam, optionalParams, optionalWarnings, StreamIdentifiers)
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Type", contentType)
Response.AddHeader("Content-Disposition", "attachment;filename=" & WarningID & ".pdf")
Response.BinaryWrite(ResultStream)
Response.Flush()
Response.End()


End Using
AnswerRe: The request failed with HTTP status 401: Unauthorized Pin
Jameel VM2-Sep-14 3:41
Jameel VM2-Sep-14 3:41 
GeneralRe: The request failed with HTTP status 401: Unauthorized Pin
Member 101656822-Sep-14 20:07
Member 101656822-Sep-14 20:07 
SuggestionRe: The request failed with HTTP status 401: Unauthorized Pin
Richard Deeming3-Sep-14 1:44
mveRichard Deeming3-Sep-14 1:44 
AnswerRe: The request failed with HTTP status 401: Unauthorized Pin
Bernhard Hiller2-Sep-14 21:19
Bernhard Hiller2-Sep-14 21:19 
QuestionAsp .Net MVC ver 4 - Change standard css template Pin
Piotrekneo182-Sep-14 0:07
Piotrekneo182-Sep-14 0:07 
AnswerRe: Asp .Net MVC ver 4 - Change standard css template Pin
Jameel VM2-Sep-14 3:36
Jameel VM2-Sep-14 3:36 
GeneralRe: Asp .Net MVC ver 4 - Change standard css template Pin
Piotrekneo184-Sep-14 10:18
Piotrekneo184-Sep-14 10:18 
QuestionAsp.net Session state Pin
Otekpo Emmanuel1-Sep-14 19:20
Otekpo Emmanuel1-Sep-14 19:20 
QuestionRe: Asp.net Session state Pin
Kornfeld Eliyahu Peter1-Sep-14 20:52
professionalKornfeld Eliyahu Peter1-Sep-14 20:52 
AnswerRe: Asp.net Session state Pin
Richard Deeming2-Sep-14 1:37
mveRichard Deeming2-Sep-14 1:37 
GeneralRe: Asp.net Session state Pin
Otekpo Emmanuel2-Sep-14 4:01
Otekpo Emmanuel2-Sep-14 4:01 
AnswerRe: Asp.net Session state Pin
ZurdoDev2-Sep-14 2:13
professionalZurdoDev2-Sep-14 2:13 
GeneralRe: Asp.net Session state Pin
Otekpo Emmanuel2-Sep-14 3:57
Otekpo Emmanuel2-Sep-14 3:57 
GeneralRe: Asp.net Session state Pin
ZurdoDev2-Sep-14 4:01
professionalZurdoDev2-Sep-14 4:01 
AnswerRe: Asp.net Session state Pin
sankarsan parida5-Sep-14 20:52
professionalsankarsan parida5-Sep-14 20:52 
QuestionHow to Restore Multiple .BAK files at a time in sql server 2008 anybody can tell me the correct way Pin
Member 1104982531-Aug-14 22:30
Member 1104982531-Aug-14 22:30 
SuggestionRe: How to Restore Multiple .BAK files at a time in sql server 2008 anybody can tell me the correct way Pin
Kornfeld Eliyahu Peter31-Aug-14 22:50
professionalKornfeld Eliyahu Peter31-Aug-14 22:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.