Page 1 of 1

Problem after change the date format in regional setting

Posted: Fri Oct 31, 2008 4:15 am
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..

Problem after change the date format in regional setting

Posted: Fri Oct 31, 2008 4:32 am
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.