Re: streaming reports from report services
Brought to you by:
wrowe
|
From: David M. <wo...@su...> - 2008-10-21 14:08:43
|
<HTML>
<P>I have pasted the error page source as well as the code that creates the report. The code fails with "response.end()". The exception message is "Thread was being aborted."</P>
<P> </P>
<P><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><BR>
<html><head><BR>
<title>200 OK</title><BR>
</head><body><BR>
<h1>OK</h1><BR>
<p>The server encountered an internal error or<BR>
misconfiguration and was unable to complete<BR>
your request.</p><BR>
<p>Please contact the server administrator,<BR>
<A href="mailto:dav...@dh...">xxxxxxxxxxxxx</A> and inform them of the time the error occurred,<BR>
and anything you might have done that may have<BR>
caused the error.</p><BR>
<p>More information about this error may be available<BR>
in the server error log.</p><BR>
</body></html><BR>
</P>
<P> Private Sub OnCallReport(ByVal tit$, ByVal sql$, ByVal connect As Data.SqlClient.SqlConnection)<BR>
Dim wr As IO.TextWriter<BR>
wr = IO.File.AppendText("c:\OnCallReport.txt")<BR>
wr.WriteLine(Format(Now, "MM/dd/yy hh:mm:ss") & " report start")<BR>
wr.Close()<BR>
Try<BR>
UserLog("report", "OnCallReport:" & tit, ui.UserID, Request, connect)<BR>
Dim localReport As New Microsoft.Reporting.WebForms.LocalReport<BR>
localReport.ReportPath = Server.MapPath("~/OnCallReport01.rdlc")<BR>
Dim command As New Data.SqlClient.SqlCommand(sql & " ORDER BY InSort", connect)<BR>
Dim reader As Data.SqlClient.SqlDataReader = command.ExecuteReader<BR>
localReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("DataSet1_DataTable1", reader))<BR>
Dim parameter() As Microsoft.Reporting.WebForms.ReportParameter = {New Microsoft.Reporting.WebForms.ReportParameter("Report_Parameter_0", tit)}<BR>
localReport.SetParameters(parameter)<BR>
SubReportConnect = New Data.SqlClient.SqlConnection(DefaultConnect)<BR>
SubReportConnect.Open()<BR>
SubReportCommand = New Data.SqlClient.SqlCommand("", SubReportConnect)<BR>
AddHandler localReport.SubreportProcessing, AddressOf OnCallReportSubreportProcessingEventHandler<BR>
Dim bytes As Byte() = localReport.Render("PDF", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)<BR>
If Not IsNothing(SubReportReader) Then SubReportReader.Close()<BR>
SubReportReader = Nothing<BR>
SubReportConnect.Close()<BR>
SubReportConnect = Nothing<BR>
reader.Close()<BR>
reader = Nothing<BR>
Response.Clear()<BR>
Response.ContentType = ""<BR>
Response.AddHeader("content-disposition", "attachment; filename=OnCallReport.pdf")<BR>
Response.BinaryWrite(bytes)<BR>
Response.End()<BR>
wr = IO.File.AppendText("c:\OnCallReport.txt")<BR>
wr.WriteLine(Format(Now, "MM/dd/yy hh:mm:ss") & " report finish")<BR>
wr.Close()<BR>
Catch ex As Exception<BR>
Dim a$ = ""<BR>
Try<BR>
a = ex.InnerException.Message<BR>
Catch<BR>
a = ""<BR>
End Try<BR>
If Len(a) > 0 Then a = "; " & a<BR>
wr = IO.File.AppendText("c:\OnCallReport.txt")<BR>
wr.WriteLine(Format(Now, "MM/dd/yy hh:mm:ss") & " " & ex.Message & a)<BR>
wr.Close()<BR>
End Try<BR>
wr.Close()<BR>
<BR>
<BR>
-- <BR>
dgm <BR>
<BR>
<BR>
<B>On Mon Oct 20 15:45 , 'William A. Rowe, Jr.' <WR...@RO...>sent:<BR>
<BR>
</B></P>
<BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #f5f5f5 2px solid; MARGIN-RIGHT: 0px">David McDivitt wrote:<BR>
<SPAN style="COLOR: #ff0000">> I have applications written in Visual Web Developer 2005 that work fine,</SPAN><BR>
<SPAN style="COLOR: #ff0000">> except for streaming reports. This works fine on IIS and I want it to</SPAN><BR>
<SPAN style="COLOR: #ff0000">> work on Apache. A PDF is streamed to the client and the "open, save,</SPAN><BR>
<SPAN style="COLOR: #ff0000">> cancel" dialog appears.</SPAN><BR>
<BR>
Exactly what failure information do you receive, and where (app logs,<BR>
apache error logs, client side messages)?<BR>
<BR>
</BLOCKQUOTE></HTML>
<BR>
|