Value cannot be null. Parameter name: source

1 Answer 297 Views
.NET Framework Report Parameters Report Viewer - MVC Rest Service
ibrahim
Top achievements
Rank 1
ibrahim asked on 07 Jan 2024, 08:39 AM

 I am using Telerik report in my c# project using their REST service, I am using the R1 2017 version, the parameters are all loading and their respective data from the database is also loading but I am getting this error when I click on preview,

When I analyzed the Telerik DLL with the error it meant that the parameters values list is null, but it can't be because I checked the network log, all the parameters are being passed to the REST API. This is the payload I'm sending

{"report":"Activity/Registered Users Report.trdp/VisionReport","parameterValues":{"CPR":"353464654","EMAIL":"","MOBILE":"","FromDate":"2023-12-31T00:00:00.000Z","ToDate":"2024-01-01T00:00:00.000Z","ChannelId":["006","002","005"]}}

to this telerik URL :

https://localhost:44302/api/reports/clients/aaf42228070/instances

When I run the same code and report in my local environment it runs properly. Still, when I deploy the code to the server, I receive this error, I ran the report on Telerik Designer on the server, there also it loads fine, it only causes issues when I am loading it in the browser on the server. Following is the complete error I'm receiving from Telerik.

 {message: "An error has occurred.", exceptionMessage: "Value cannot be null. ↵Parameter name: source",…}
    exceptionMessage
    : 
    "Value cannot be null.\r\nParameter name: source"
    exceptionType
    : 

"System.ArgumentNullException"
message
: 
"An error has occurred."
stackTrace
: 
"   at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)\r\n   
at Telerik.Reporting.Services.Engine.PersistableCollection`1.GetEnumerator()\r\n   
at Telerik.Reporting.Services.Engine.KeyItemPersistableCollection`2.ResolveItem(K referredInstanceKey, Boolean& newItem)\r\n   
at Telerik.Reporting.Services.Engine.ReportEngine.CreateReportInstance(String clientID, String report, Dictionary`2 parameterValues)\r\n   
at Telerik.Reporting.Services.WebApi.ReportsControllerBase.CreateInstance(String clientID, ClientReportSource reportSource)\r\n   
at lambda_method(Closure , Object , Object[] )\r\n   
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_1.<GetExecutor>b__3(Object instance, Object[] methodParameters)\r\n  
 at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   
 
 
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   
 at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   
 
 
 
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   
 at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   
 at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   
 
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n  
 at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()

1 Answer, 1 is accepted

Sort by
0
Momchil
Telerik team
answered on 10 Jan 2024, 03:58 PM

Hi Ibrahim,

Usually, this error occurs when the Storage of the Reporting REST Service has been corrupted and tends to happen most frequently when the FileStorage implementation is being used. Clearing the storage should resolve the issue.

You can see what kind of storage you are using by checking the ReportServiceConfiguration.Storage property.

If you are using file storage, note that we do not recommend it for production purposes and you might want to migrate to one of the IStorage implementations suitable for deploying both on single instance application hosting and in Web Farms.

Last but not least, if the issues persist after deleting the storage, please record the following logs and send them to me for additional investigation.

I hope this helps.

Regards,
Momchil
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Tags
.NET Framework Report Parameters Report Viewer - MVC Rest Service
Asked by
ibrahim
Top achievements
Rank 1
Answers by
Momchil
Telerik team
Share this question
or