Problem after change the date format in regional setting

Stimulsoft Reports.NET discussion
Post Reply
magicang
Posts: 9
Joined: Tue Jun 27, 2006 10:21 pm

Problem after change the date format in regional setting

Post by magicang »

Hi there,

I have create a report on my computer with M/d/yyyy format and it's run well.

But after i change my computer's regional date format to d/M/yyyy, the report cannot run and it's prompt :-
"The conversion of a char data type to a datetime date type resulted in an out-of-range datetime value"
:cry:

How to solve this problem ?

Thanks in advance..
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Problem after change the date format in regional setting

Post by Edward »

Hi.

If you assign DateTime values as strings to parameters, variables and so on, then you have to take into consideration the fact that inner representation of the DateTime format in Stimulsoft Reports.Net is 'MM.dd.yyyy'.

But it is better do not assign a DateTime type variables or parameters as strings at all.

For example, if you have a DateTime variable v, then the best way to assign it with a new value like that:

Code: Select all

v = new DateTime(2008,10,31);
Try to avoid assignments when DateTime is being passed as a string.

Could you explain where in your report this error have occurred because there was not enough info about it to give your an advice which would relevant to the case.

Thank you.
Post Reply