Problem with Date parameter and non-US localization.

6 posts, 0 answers
  1. Ole
    Ole avatar
    36 posts
    Member since:
    Aug 2010

    Posted 04 Nov 2010 Link to this post


    I have a report with a dateTime type report parameter, which is used in a where quairy in sqldatasource   . It works when I run it with with this

    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");



    Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");


    in the report initializer.

    How ever when running the report in my default culture (is-IS) the report fails with the message 

    The conversion of nvarchar data type to datatime data type resulted in an out of range value.

    This happens when the day of month is greater than 12 , so it thinks that the day is the month.

    Is this a bug ?.


  2. Peter
    Peter avatar
    1629 posts

    Posted 09 Nov 2010 Link to this post

    Hello Ole,

    We are unable to reproduce the described error locally. Please check out the attached sample project. If you still experience difficulties we will highly appreciate if you open a support ticket and send us a sample project the exhibits the issue. Thus we will be able to debug it locally and advise you accordingly.

    Sincerely yours,
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. erwin
    erwin avatar
    381 posts
    Member since:
    Dec 2006

    Posted 21 Jan 2014 Link to this post

    I have exactly the same problem - any news on this? (20013 Q3 latest internal build on winforms)
    The report works when Regional Settings are set to English(US) but not when set to German(Switzerland)

    The error message is not really helpful. It should at least provide some information about the context, for example that a report parameter is the source of the conversion error.
  4. erwin
    erwin avatar
    381 posts
    Member since:
    Dec 2006

    Posted 21 Jan 2014 Link to this post

    OK, found it after it became clear to me that the error message comes form SQL Server / SQL Server client not from Telerik Reporting itself.
    The problem was that I declared the datasource parameters as string instead of datetime.
    The nasty thing is that it works under US Regional settings (of course).

  5. Hinata
    Hinata avatar
    146 posts
    Member since:
    Dec 2013

    Posted 23 Jan 2014 Link to this post

    Thanks for sharing this erwin. I've been struggling with a similar issue lately.
  6. erwin
    erwin avatar
    381 posts
    Member since:
    Dec 2006

    Posted 23 Jan 2014 Link to this post

    Glad I could be of help!
Back to Top