Recently, I was asked to develop a SSRS based report for the Event Management module in MS Dynamics CRM 2011. The idea was to show a Calendar for the selected month and each cell of the calendar should display the scheduled events of that day.
Showing the events in the required format in each cell was not a big issue. The main challenge was to generate a dynamic grid of Calendar. Luckily, the CRM was deployed on-premises and I got a chance to use TSQL to generate the Calendar.
Below is the TSQL which I came up with to generate the Calendar -
Hope, this will help!
Edit : 14th April 2013 – Replacing NULLS with previous & next dates.
Below is the modified script that will display the dates from the previous & next month instead of NULL