While using the Silverlight RadHTMLPlaceholder I've assembled a wait indicator that ends on the "UrlLoaded" event. The event actually fires when redirecting to common links like www.google.com, etc., but it doesn't in my particular instance. I'm redirecting to an ASPX page within the solution that renders a PDF into a Byte array and writes it to the page. Everything works wonderfully aside from firing the UrlLoaded event which, again, is only being used to stop the wait indicator... Yes, I have OCD. :)
Here is the page's code (reduced for easy reading):
Private Sub RunReport(ByVal ReportName As String)
Dim iReport As LocalReport
Select Case ReportName
Case "Bankruptcy"
' Set up the report parameters
Dim iDate As Date = Request.QueryString("date")
' Grab the data
Dim iBankruptData As DataSet = DBAccess.SRReports.GetBankruptcyAndDelinquency(iDate)
' Set the data sources
Dim iData1 As New ReportDataSource("Bankruptcy", iBankruptData.Tables(0))
Dim iData2 As New ReportDataSource("Delinquency", iBankruptData.Tables(1))
' Add the parameters
Dim iReportParms(0) As ReportParameter
iReportParms(0) = New ReportParameter("ReportDate", CDate(iDate), False)
' Set up the report
iReport = New LocalReport With {.ReportPath = Server.MapPath(".") & "\Bankruptcy.rdlc", .DisplayName = "Bankruptcy"}
iReport.SetParameters(iReportParms)
iReport.DataSources.Clear()
iReport.DataSources.Add(iData1)
iReport.DataSources.Add(iData2)
End Select
' Set up the rendering parameters
Dim iReportType As String = "PDF"
Dim iDeviceInfo As String = Nothing
Dim iMimeType As String = Nothing
Dim iEncoding As String = Nothing
Dim iFileNameExtension As String = "PDF"
Dim iWarnings As Warning() = Nothing
Dim iStreams As String() = Nothing
' Render the report
Dim iReportBytes As Byte()
iReportBytes = iReport.Render(iReportType, iDeviceInfo, iMimeType, iEncoding, iFileNameExtension, iStreams, iWarnings)
' Now, let's display the report as a new pdf
With Response
.ClearHeaders()
.ClearContent()
.Buffer = True
.ContentType = "application/pdf"
.AddHeader("Content-Disposition", "inline;filename=" & ReportName & ".pdf;")
'.AddHeader("Content-Disposition", "attachment;filename=" & ReportName & ".pdf") ' For displaying in client's default PDF reader
.AddHeader("Content-Length", iReportBytes.Length.ToString())
.BinaryWrite(iReportBytes)
.Flush()
.End()
End With
End Sub