Monday 9 January 2012

SSRS Report - UTC / UK Time Issue

I came accross an issue recently, I created a SSRS Report from scratch and set the locationisation to en-GB which displays the dates etc in a dd/mm/yyyy format. This presented me with a problem, when connecting to a crm online server it likes the format to be in utc so when I passed 01/08/2011 (1st August 2011) it thought i was passing 08/01/2011 (8th January 2011).

The solution it seems was to edit the rdl file in notepad and change the query parameter, which once I found out where/how was a 10 second job.

The steps were:

Find the location of the Report in question
Right click on the report and select Open with
Choose Notepad
Do a find for <QUeryParamater>


Original Code:<QueryParameters>
 <QueryParameter Name="@StartDate">
        <Value>=Parameters!StartDate.Value</Value>
</QueryParameter>


New Code:<QueryParameters>
 <QueryParameter Name="@StartDate">
        <Value>=Format(Parameters!StartDate.Value,"MM-dd-yyyy")</Value>
</QueryParameter>


Notice the change in the Value, this simply formats the value into a mm-dd-yyyy format and then your away.

Enjoy

No comments:

Post a Comment

ADFS Timeout on Server 2012 for CRM 2011

This follows on from this Microsoft Guide http://social.technet.microsoft.com/wiki/contents/articles/7681.setting-the-adfs-timeout-for-crm...