Hit a snag today trying to set the format on date parameters that drive SSRS 2012 reports – at first I thought it would be simple to fix but after searching around for solutions, didn’t come up with much.
The specific problem I was/am having is that when you use Date/Time parameters to drive a report built in SSRS 2012 the date formats always revert to US format after choosing a date from the calendar control – making your date selections incorrect, or sometimes invalid, depending on the dates you have chosen. I don’t know if this problem exists when using the native viewer, but certainly many people have reported it in SharePoint integrated mode.
Changing the Language property of the report, the regional settings of the client or the regional settings of the server all make no difference (though I suspect that they also have to be set correctly).
The only solution that I found is to hard code the UICulture value into RSViewerPage.aspx, which on my system was found in:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ReportServer
The modified code looks like this:
<%@ Page language=”C#” Codebehind=”RSViewerPage.aspx.cs” AutoEventWireup=”false” Inherits=”Microsoft.ReportingServices.SharePoint.UI.RSViewerPage,Microsoft.ReportingServices.SharePoint.UI.ServerPages,Version=188.8.131.52,Culture=neutral,PublicKeyToken=89845dcd8080cc91″ UICulture=”en-GB” %>
Changing the UICulture worked for me, but introduced a problem of its own – I lost the formatting of the sidebar on report viewer, after a little digging I found out why. As you may not be using “en-GB” you can also use the method to adapt it to your region.
The reason that formatting vanished is because I set my UICulture to en-GB which according to this page:
Has a locale ID of 2057, previously the page source all referred to 1033 which is “English (United States)”. Having changed the UICulture it is now looking for folder “2057, which does not exist. There is a Styles subfolder which contains styles for each locale, on my system the full path to this was:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ReportServer\styles
There are lots of entries in that folder for many different locales, but not one for 2057 (Presumably because it is the same as en-US for the most part).
I simply copied the contents of 1033 to a new folder called 2057 and the formatting came back.
Pretty simple to fix when you have dug through the system and found all the relevant files, but not easy to discover. I’m not really happy with this fix and would be very pleased to hear of any better, more official ways of fixing the problem. Surely there are lots of people in other regions not using the US date formats for their Sharepoint Integrated reports. I’m not fond of manually tweaking the report viewer code.