System.NullReferenceException in DateTimeUtil.ParseDateToDefaultFormat

Serhii K 11 Reputation points
2021-02-09T17:58:05.827+00:00

Hi,

I use Microsoft.ReportingServices.ReportViewerControl.WebForms to display reports in my ASP.Net MVC project.
After upgrade to 150.1427.0 version I started getting an exception when setting parameter values that are dates or int values.
Here is the stack trace:

Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.ReportingServices.Common.DateTimeUtil.ParseDateToDefaultFormat(String strDateTime, CultureInfo formatProvider)
at Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1 parameters)

According to the release notes there is a point: "Fixed a datetime parsing issue affecting certain locales."
https://learn.microsoft.com/en-us/sql/reporting-services/application-integration/release-notes-ssrs-application-integration?view=sql-server-ver15
So maybe something was broken there.

As I understand locale is taken from Thread.CurrentThread.CurrentCulture.Name and I have "en-US" value there, but it still doesn't work.

If I downgrade to version 150.1404.0 and the issue has gone.

Is there a way to make it work in 150.1427.0 version?

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,849 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 34,581 Reputation points
    2021-02-10T07:16:22.527+00:00

    Hi @Serhii K ,

    The issue is related about develop, I'm not familiar with it.

    As far as I known that there is a lot of differences between WebForms and MVC.

    ReportViewer requires viewState and that's not in MVC.

    We will need to go through some hacks to make it work. Generally speaking, it's not suggested to use the web form control in MVC.

    So when we meet with some issue with ReportViewerControl and MVC, it's hard to define the issue.

    You may post this issue here.This site will serve as a connecting point between you and Microsoft, and ultimately the large community for you and Microsoft to interact with. Your feedback enables Microsoft to offer the best software and deliver superior services, meanwhile you can learn more about and contribute to the exciting projects on Microsoft feedback.

    Regards,

    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues October


  2. Serhii K 11 Reputation points
    2021-02-11T16:08:00.24+00:00

    Hi @ZoeHui-MSFT ,

    Ok, thanks. I give it a try on another forum, that you suggested.

    0 comments No comments