Error registering the viewer with the service string was not recognized as a valid DateTime.

7 posts, 0 answers
  1. Stuart
    Stuart avatar
    10 posts
    Member since:
    Dec 2011

    Posted 07 Aug 2017 Link to this post

    Using Telerik ReportViewer Q3 2015 SP2 v9.2.15.1126 in a MVC HTML5 website application.  I am experiencing an intermittent error with the reportviewer.

    "Error registering the viewer with the service.  An error has occurred.  String was not recognised as a valid DateTime."

    This occurs when instantiating a report for the first time (starting the website up and running a report).  However, rerunning the report immediately again I then get the expected result and it works fine without error, but the error is guaranteed to occur on every first time use.... 

    Fiddler returns the following information:

    {"message":"An error has occurred.","exceptionMessage":"String was not recognized as a valid DateTime.","exceptionType":"System.FormatException","stackTrace":"   at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)\r\n   at System.DateTime.ParseExact(String s, String format, IFormatProvider provider)\r\n   at Telerik.Reporting.Services.Engine.PersistableObject.GetDateTime(String key)\r\n   at Telerik.Reporting.Services.Engine.Client.get_ExpiresOn()\r\n   at Telerik.Reporting.Services.Engine.ReportEngine.<>c__DisplayClass16.<CollectExpiredData>b__10(Client c)\r\n   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)\r\n   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)\r\n   at Telerik.Reporting.Services.Engine.ReportEngine.CollectExpiredData()\r\n   at Telerik.Reporting.Services.Engine.ReportEngine.RegisterClient()\r\n   at Telerik.Reporting.Services.WebApi.ReportsControllerBase.RegisterClient()\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at
    System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()"}

     

    Anyone experienced this before?  Any advice how to stop this from happening?  We have tried the obvious things like clearing browser history etc...

     

  2. Katia
    Admin
    Katia avatar
    693 posts

    Posted 10 Aug 2017 Link to this post

    Hi Stuart,

    We had one report about a similar issue, however, we never managed to reproduce it on our side and the cause of the issue was not discovered.
    The client then reported that he managed to fix the issue by changing the HostAppId in ReportsController. It is not clear to us how this issue can be connected to the HostAppId setting.

    In general, the error points that somewhere happens a conversion from string value into a DateTime value. If machines have different culture settings, the string may not be parse on one of them.

    The things you can check:
    1. an expression used by the report e.g. TextBox.Value with formatting or a rule comparing values
    2. a mapping of field to a report parameter in a data-retrieval method, both field and parameter must be of DateTime type to avoid the automatic conversion
    3. a value passed to the report via report parameter

    We can provide more accurate suggestions after testing a sample project that reproduces the issue.


    Regards,
    Katia
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Kiran
    Kiran avatar
    12 posts
    Member since:
    Sep 2013

    Posted 04 Jun in reply to Katia Link to this post

    Hi There.

    I am facing the same issue "Error registering the viewer with the service string was not recognized as a valid DateTime". for testing purpose I am running the blank report. no data. no date. and still having the same message. please help on this

  4. Kiran
    Kiran avatar
    12 posts
    Member since:
    Sep 2013

    Posted 04 Jun in reply to Kiran Link to this post

    Fyi: I have started receiving this issue suddenly. nothing new has been installed on system
  5. Silviya
    Admin
    Silviya avatar
    178 posts

    Posted 07 Jun Link to this post

    Hello Kiran,

    Unfortunately, we are still not able to reproduce the error on our side. 

    Please open new support ticket with a sample project that reproduces the problem in order to investigate it further and provide more accurate suggestions.
    Additionally, please elaborate more on the following: 
    - do you change the HostAppId string in ReportsController?
    - what is your current culture set?
    - which is the current used version of Telerik Reporting?

    Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Tim
    Tim avatar
    1 posts
    Member since:
    May 2016

    Posted 13 Aug Link to this post

    We encountered the same error. We build our product one time and deploy it to multiple clients. Only 1 client exhibited this behavior which rules out any application-specific issue. We also monitored for any data-related issue and found the request was failing on the request to api/reports/clients which caused every report to fail prior to any data-related processing. The notes about changing the HostAppId lead me to the consideration that something may be invalid in the Telerik Cache. I stopped the application pool and renamed the cache file as follows:

    C:\Users\__serviceAccountName__\AppData\Local\Temp\__HostAppId__ 

    Renamed to:

    C:\Users\__serviceAccountName__\AppData\Local\Temp\__HostAppId-bk__ 

    Where __serviceAccountName__ is the name of the application pool service account and __HostAppId__ is the value the ReportServiceConfiguration.HostAppId is set to.

    When the application restarted I saw a new folder was created in place of the -bk folder and all reports run without any further issue.

    I retained the backup files if they will help you further diagnose the issue and resolve the bug in your product.

     

     

     

  7. Silviya
    Admin
    Silviya avatar
    178 posts

    Posted 16 Aug Link to this post

    Hi Tim,

    Please check the support ticket with ID 1338344 that I opened on the same topic.

    Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top