or
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
ExportToPDF("NoiseTestBlanks.trdx")
End Sub
Sub ExportToPDF(ByVal reportToExport As String)
Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor()
Dim typeReportSource As New Telerik.Reporting.TypeReportSource()
' reportToExport is the Assembly Qualified Name of the report
typeReportSource.TypeName = reportToExport
Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", typeReportSource, Nothing)
Response.Clear()
Response.ContentType = result.MimeType
Response.Cache.SetCacheability(HttpCacheability.Private)
Response.Expires = -1
Response.Buffer = True
'Uncomment to handle the file as attachment
'Response.AddHeader("Content-Disposition", String.Format("{0};FileName=""{1}""", "attachment", reportToExport))
Response.BinaryWrite(result.DocumentBytes)
Response.End()
End Sub
Error: System.Reflection.TargetInvocationException : An exception occurred during the operation, making the result invalid. Check InnerException for exception details.
em System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
em Telerik.Reporting.Service.SilverlightClient.ListRenderingExtensionsEventArgs.get_Extensions()
em Telerik.ReportViewer.Silverlight.ReportViewerModel.OnListRenderingExtensionsCompleted(Object sender, ListRenderingExtensionsEventArgs e)
------------- InnerException: -------------
System.ServiceModel.CommunicationException : The remote server returned an error: NotFound.
em System.ServiceModel.Channels.Remoting.RealProxy.Invoke(Object[] args)
em proxy_3.EndListRenderingExtensions(IAsyncResult )
em Telerik.Reporting.Service.SilverlightClient.ReportServiceClient.OnEndListRenderingExtensions(IAsyncResult result)
em System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
------------- InnerException: -------------
System.Net.WebException : The remote server returned an error: NotFound.
em System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
em System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
em System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
------------- InnerException: -------------
System.Net.WebException : The remote server returned an error: NotFound.
em System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
em System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassa.<
EndGetResponse
>b__9(Object sendState)
em System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<
BeginOnUI
>b__1(Object sendState)