This is a migrated thread and some comments may be shown as answers.

ReportViewer report load error

2 Answers 227 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 12 Aug 2014, 09:36 PM
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? 

2 Answers, 1 is accepted

Sort by
0
Brett
Top achievements
Rank 1
answered on 13 Aug 2014, 05:59 PM
I have attached a screenshot of the reportViewer error. The reportViewer fails to display the report on page load (http://localhost:xxxxxx/api/v1/Reports/clients/134031-b299/instances/134032-98ad/documents/134032-11c4/info), but I am able to export it as a PDF (http://localhost:xxxxx/api/v1/Reports/clients/133656-5291/instances/133657-3ea4/documents/133749-cbc1/info) and an Excel spreadsheet (http://localhost:xxxxx/api/v1/Reports/clients/133656-5291/instances/133657-3ea4/documents/133713-10e8/info).
0
Nasko
Telerik team
answered on 15 Aug 2014, 10:34 AM
Hello Brett,

We haven't encountered such issue before. Please, attach a runnable sample project exhibiting the problematic behavior here or in a new support ticket, so we can debug it at our end and advise accordingly.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Brett
Top achievements
Rank 1
Answers by
Brett
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or