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()"
The exception seems related to the Storage of the Reporting REST Service. I assume you use FileStorage since I have seen this problem with such storage type. It might be due to some 3rd party software (antivirus, backup tool, etc.) that locks the files that get frequently accessed.
The stack trace shows that the exception is thrown when enumerating the storage collections. You may use a tool like File Locksmith and see who's locking the folder of the service Storage.
Generally, Telerik does not recommend FileStorage for production purposes. It's unreliable mostly due to the inefficient locking mechanism. MSSQL or Redis Storage options are way better.
These Telerik Reporting resources may also be useful: