Wednesday, July 29, 2009

Conditional Formatting in Reporting Services using Common Code

The lack of support for CSS style sheets in reporting services can make life difficult when you want to have common formatting across reports. There are also occasions where you may want to share common conditional formatting logic across reports. This example shows how common code can be used to help in these scenarios.

Whilst a .NET assembly would probably be more efficient not everybody is in a position to write and deploy .NET assemblies.

The first example simply sets the background color of a textbox based on the value of a variable.

In this example the textbox background is set to red if the value is less than 50 otherwise it is set to green. This logic may be required in multiple textboxes in a single report or across multiple reports.
Open your report and under properties add the following to the code

function StopGoColor(d as decimal) as string
StopGoColor = iif(d < style="font-family:arial;">end function

Select the textbox where you want apply the conditional formatting and enter the following expression for the fill color using your own value to pass to the function


This function can be used through out your report to ensure consistant formatting.

Once you have written the functions you require you can create a report template by copy the code into an empty report and saving this report into the C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject direcory.

Now when you select Add New you will get the option to base any new report on the newly created template report which already contains your common formatting code.

Monday, July 13, 2009

Kathleen Dollard's Slides

The slides from Kathleen's talk can be found on her blog

Friday, July 10, 2009

Mobile Express for Microsoft CRM 4.0 released

Microsoft have just released mobile express for CRM 4.0 which allows you to access your CRM data on mobile devices including iPhones

It's a shame it has taken this long to get it out and it will be interesting to see what happens when version 5.0 of CRM is released - due this year I believe. The mobile version should really be part of the core product release.