We have a SSRS report that accepts one date/time input parameter. We have found that the report fails when it is executed from our Silverlight clients with the following error:
"The value provided for the report parameter 'CurrentDate' is not valid for its type."
On further investigation we have found that the report fails when the date value being passed over to the report has a day number greater than 12. e.g. 01/01/2011 is OK. 17/06/2011 will fail. This tells us that the report on the SSRS box must be expecting the date in American format i.e mm/dd/yyyy.
How can I fix this? So far I have tried the following:
I have set the Language property on the report to en-GB. This makes no difference. I have changed the locale in the Silverlight code just before the report is executed e.g.
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
ExecuteReport();
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-GB");
This works but I am not happy with this solution. It seems like a big hack just to get dates accepted on our SSRS reports.
Why is SSRS expecting all date parameters to be in US format? Can I resolve this without jumping through hoops? Please help!