Hello,
I am experiencing a problem trying to view a Telerik Report. The report is hosted on a Web Api project and is being accessed by an MVC project using the Javascript version of the ReportViewer. The ReportViewer is able to find the correct report but before it can be displayed I'm getting an error. The error is on this call to the Web Api project: http://localhost:xxxxxx/api/v1/Reports/clients/102235-d59f/instances/102235-d67f/documents/102235-8013/info. The error is "Specified cast is not valid". Here is the full stack trace:
Telerik.Reporting.Services.Engine.DocumentRenderException: Specified cast is not valid.
at Telerik.Reporting.Services.Engine.Document.GetDocumentInfo()
at Telerik.Reporting.Services.Engine.ReportInstance.<GetDocumentInfo>b__c(Document d)
at Telerik.Reporting.Services.Engine.ReportInstance.ExecuteOnDocument[T](String documentID, Func`2 function)
at Telerik.Reporting.Services.Engine.ReportInstance.GetDocumentInfo(String documentID)
at Telerik.Reporting.Services.Engine.Client.<>c__DisplayClass1b.<GetDocumentInfo>b__1a(ReportInstance i)
at Telerik.Reporting.Services.Engine.Client.ExecuteOnReportInstance[T](String instanceID, Func`2 function)
at Telerik.Reporting.Services.Engine.Client.GetDocumentInfo(String instanceID, String documentID)
at Telerik.Reporting.Services.Engine.ReportEngine.<>c__DisplayClass15.<GetDocumentInfo>b__14(Client client)
at Telerik.Reporting.Services.Engine.ReportEngine.WithClient[T](String clientID, Func`2 func)
at Telerik.Reporting.Services.Engine.ReportEngine.GetDocumentInfo(String clientID, String instanceID, String documentID)
at Telerik.Reporting.Services.WebApi.ReportsControllerBase.GetDocumentInfo(String clientID, String instanceID, String documentID)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
Like I said, it is not an issue of it not being able to find the report. In fact, even though this error is occurring, I can use the export menu of the ReportViewer to export the report to PDF, Excel, etc and it works fine. Can you please advise on this issue?
I am experiencing a problem trying to view a Telerik Report. The report is hosted on a Web Api project and is being accessed by an MVC project using the Javascript version of the ReportViewer. The ReportViewer is able to find the correct report but before it can be displayed I'm getting an error. The error is on this call to the Web Api project: http://localhost:xxxxxx/api/v1/Reports/clients/102235-d59f/instances/102235-d67f/documents/102235-8013/info. The error is "Specified cast is not valid". Here is the full stack trace:
Telerik.Reporting.Services.Engine.DocumentRenderException: Specified cast is not valid.
at Telerik.Reporting.Services.Engine.Document.GetDocumentInfo()
at Telerik.Reporting.Services.Engine.ReportInstance.<GetDocumentInfo>b__c(Document d)
at Telerik.Reporting.Services.Engine.ReportInstance.ExecuteOnDocument[T](String documentID, Func`2 function)
at Telerik.Reporting.Services.Engine.ReportInstance.GetDocumentInfo(String documentID)
at Telerik.Reporting.Services.Engine.Client.<>c__DisplayClass1b.<GetDocumentInfo>b__1a(ReportInstance i)
at Telerik.Reporting.Services.Engine.Client.ExecuteOnReportInstance[T](String instanceID, Func`2 function)
at Telerik.Reporting.Services.Engine.Client.GetDocumentInfo(String instanceID, String documentID)
at Telerik.Reporting.Services.Engine.ReportEngine.<>c__DisplayClass15.<GetDocumentInfo>b__14(Client client)
at Telerik.Reporting.Services.Engine.ReportEngine.WithClient[T](String clientID, Func`2 func)
at Telerik.Reporting.Services.Engine.ReportEngine.GetDocumentInfo(String clientID, String instanceID, String documentID)
at Telerik.Reporting.Services.WebApi.ReportsControllerBase.GetDocumentInfo(String clientID, String instanceID, String documentID)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
Like I said, it is not an issue of it not being able to find the report. In fact, even though this error is occurring, I can use the export menu of the ReportViewer to export the report to PDF, Excel, etc and it works fine. Can you please advise on this issue?