# Wednesday, September 12, 2012

I have been listening to DotNETRocks almost since the show's inception and I am an unapologetic fan. I'm not the only one: The show is the oldest and most popular podcast target at .NET developers.

So I was thrilled to learn that hosts Richard Campbell and Carl Franklin planned a cross-country Road Trip and that this trip would include a stop in the Detroit area. Upon hearing about the Road Trip, I immediately reached out to Carl and Richard to ask how I could help. It has been a few weeks since the initial announcement and plans are now taking shape.

Richard and Carl will be in Michigan on Tuesday October 9. The Great Lakes Area .NET User Group (GANG) will hold a special meeting to host the event. Jeff Wilcox, creator of the Fourth and Mayor Windows Phone 7 app will be their guest.

This event will include the following:

  • A presentation by Jeff Wilcox
  • A barbeque dinner from Lockhart's barbeque in Royal Oak, MI (courtesy of a generous donation from New World Systems)
    A live recording of Carl and Richard interviewing Jeff for an upcoming episode of DotNetRocks. The audience will have an opportunity to ask questions of Jeff
  • A technical presentation by Carl Franklin
  • A technical presentation by Richard Campbell

This is a lot to pack into one night, but if you are a regular GANG attendee, you know that we regularly pack a great deal into each meeting.

Richard Campbell traveled to GANG in 2011 and that meeting was one of our most successful ever!

This evening is made possible by the vision of Carl Franklin and Richard Campbell and by the hard work of the Great Lakes Area .NET User Group volunteers.

Because of the limited seating, the popularity of the event, and the need to buy the right amount of food, you will need to register in advance for this free event. Do so at http://dotnetrocks.eventbrite.com/.

You can learn more about the Great Lakes Area .NET User Group at http://migang.org.

Wednesday, September 12, 2012 3:24:10 PM (GMT Daylight Time, UTC+01:00)
# Tuesday, September 11, 2012

Last week, I demonstrated how to embed code directly into a SQL Server Reporting Service (SSRS) report.

In this article, I will explain how to reference code in an external assembly from an SSRS report. The basic steps are

  1. Create External Code
  2. Create Unit Tests
  3. Deploy the assembly to the Report Server
  4. Add a reference to the assembly
  5. Call external functions in Expression Editor
  6. Deploy Report

Create External Code

The first step is to create and compile the external code. The project type will be a Class Library and you will add a public class with a public static method. This code can be in C#, Visual Basic, or F#.
A sample is shown below in Listing 1.

using System;

namespace ReportFunctions
    public class ReportLib
        public static string FormatAs2Digits(decimal? input)
            if (input == null)
                return "N/A";
                return String.Format("{0:##,##0.00;(##,##0.00)}", input);

Listing 1

Compile this code in Release mode

Create Unit Tests

It's a good idea to create unit tests around this code because it can be difficult to test it on the Report Server.
At a minimum, write tests that mimic how you expect to call the function within your reports.

Deploy Assembly to Report Server

In order to use the functions, you must deploy the compiled DLL to the report server. You can either create a Setup  project to create an MSI package or you can simply copy the DLL to the drive where SQL Server Reporting Services is installed in the following folder on the SQL Server installation drive:

\Program Files\Microsoft SQL Server\Instance_Name\Reporting Services\ReportServer\bin

where Instance_Name is the name of the instance of SQL Server on which SSRS is running.

Add a reference to the assembly

Open your Report project and open the report that will call the custom function. From the menu, select Report | Report Properties. Select the References tab (Fig. 1).

Fig. 1 – “Reference” tab of Report Properties

Browse to select the deployed assembly containing the code you want to call.

After adding the reference, you will need to compile the Report project before you  can use the assembly functions. To compile the report, select Buld | Build Solution from the menu.

Call external functions in Expression Editor

Open an expression editor and call a function in the external assembly. You will need to include the entire namespace and classname. In our example, this be

An example is shown in Fig. 2.

Fig. 2 – Expression Editor

You can test that the expression works by clicking the Preview tab of the report.

Deploy Report

The final step is to deploy the report. Assuming you have permissions on the Report Server and the report sever is set in the project properties, the easiest way to deploy is to right-click the report in the Solution Explorer and select Deploy.

Now you can test the report and the function on the Report Server.


In this article, we described how to call code in an external assembly from a SQL Server Reporting Services report.

.Net | SQL Server | SSRS
Tuesday, September 11, 2012 10:20:41 PM (GMT Daylight Time, UTC+01:00)
# Monday, September 10, 2012
Monday, September 10, 2012 6:44:00 PM (GMT Daylight Time, UTC+01:00)
# Friday, September 7, 2012

Sometimes I find myself applying the same formatting or performing the same task to many elements within a SQL Server Reporting Services (SSRS) report.

When this happens, I consider writing a reusable function to perform this task or formatting. Functions can be added directly to an SSRS report.

To add code to an SSRS report, open the report and select Report | Report Properties from the menu. The Report Properties dialog displays. Select the Code tab to bring this tab forward (Fig. 1).

Fig 1: The Code tab of the SSRS Report Properties dialogue

This tab contains a single edit box into which you can type Visual Basic code. The editor is very limited in that you can only use Visual Basic (no C#, F#, or JavaScript), and it provides no IntelliSense. Still, it does allow you to create functions that can be called elsewhere within your report. Type your function within this edit box.

Note: If, like me, you are having trouble writing valid code with the IntelliSense or other syntax-checking, It might be helpful to create a console application in Visual Studio and type the same function in order to validate the function's syntax and functionality.

In SSRS, you assign an expression to an object’s property using the Expression Editor (Fig. 2)

Fig2: The SSRS Expression Editor

In an Expression editor of any object on the report, you can call the function with the word "Code", followed by ".", followed by the name of the function.

For example, I found that I had a number of textboxes that displayed numeric data. I wanted every number to display with the following rules:

  • Format the numeric output so exactly 2 digits appear to the right of the decimal point
  • Print "N/A" for null values.

I could accomplish this by doing the following:

  1. Set the formatting of every textbox to "##,##0.00;(##,##0.00)"
  2. Change the expression in each textbox to something like:
    =Iif(IsNothing (Fields!Price), "N/A", Fields!Price)

But this is inefficient because one needs to perform the above steps for every textbox where this change is needed.

Instead, I created the following function and embedded it into the report:

Public Shared Function FormatAs2Digits(ByVal input as Nullable( of decimal)) as string
    return Iif(IsNothing (input), "N/A", Format(input, "##,##0.00;(##,##0.00)"))
End Function

Then, I could set the expression of each textbox to something similar to the following


Be aware that your report runs under a specific user context and that user will likely have very limited access rights, so your functions will be limited in what that user context can do. Generally, I only use functions to format data and perform other tasks encapsulated within the report.

Despite its limitations, an embedded function is an excellent way to create reusable code and consume it in multiple objects within an SSRS report.

Friday, September 7, 2012 9:19:29 PM (GMT Daylight Time, UTC+01:00)
# Monday, September 3, 2012
Monday, September 3, 2012 5:29:02 PM (GMT Daylight Time, UTC+01:00)
# Tuesday, August 28, 2012

Here is Randy Pagels's presentation on What's New in Visual Studio 2012at the August 2012 Great Lakes Area .NET User Group meeting.

Tuesday, August 28, 2012 6:14:01 AM (GMT Daylight Time, UTC+01:00)
# Monday, August 27, 2012
Monday, August 27, 2012 11:54:00 PM (GMT Daylight Time, UTC+01:00)
# Thursday, August 23, 2012

The organizers of That Conference knew a good thing when they saw it. For years, CodeMash has set the standard for community technical events. And when community leaders from Illinois and Wisconsin saw the success of CodeMash and experienced how well it was run, they resolved to create something similar.

The similarities are immediately apparent - a large polyglot developer conference, run by volunteers, taking place at an indoor waterpark. They even chose another location (Wisconsin Dells, WI) of the Kalahari water park. They added a bacon bar - an idea that I first saw implemented at CodeMash earlier this year and upped the ante by roasting a pig for dinner one night.

But it's not enough just to draw inspiration from success, have a good concept, and borrow a few ideas. To be successful, you still need to execute well. And the organizers of That Conference executed their plan very well.

They attracted an impressive list of speakers covering a wide variety of topics. Not only did this make the presentations great, but it also made the lunchtime and hallway conversations great. I saw some excellent presentations by Steve Bodnar, Jimmy Bogard, and Scott Hanselman, among others. My favourite was Bogard's session, which described how to write code that is easier to functional test.

My presentation on Azure Storage went really well. The audience was great. They asked good questions and were genuinely interested in this technology. I even overheard a couple people talking about my presentation in the lunch line. And thanks to Bob Laskey, I now have a new photo (below) that I can use on my conference profile pages. As you can see, I was very excited about my presentation.

Photo by Bob Laskey

But talking one-on-one with experts in the industry is where I get the most value from these conferences and I gained a lot of value from conversations at this conference (or is it “that conference”?). Many of the talks were so interesting, that I asked permission to record them, so you will soon see Chris Powers, Keith Casey, Ian Felton, Scott Hanselman, Samid Basu, Clark Sell, Jeff Nuckolls, Jay Harris, Michael Collier, and Ted Neward on Technology and Friends. Topics ranged from Windows Azure to telephony to home automation to the relationships between developers and managers.

That Conference included a few extra events, including a hackathon, a code retreat, a game night, open spaces, and a night in which the water park stayed open until 1AM, allowing the attendees a chance to play.

The only downside was the cost to attend, which was higher than most community events. The ticket cost was very reasonable ($350 for 3 days), but hotel rooms were almost $200 a night, the flight to Wisconsin was expensive, and the closest major airport is over an hour from Kalahari, meaning one still needed ground transportation. I was fortunate to receive sponsorship from Telerik (a sponsor of That Conference)and others received a training budget from their employers, but not everyone is so fortunate. Still, it is much cheaper than the large for-profit technical conferences.

600 attendees is an impressive turnout for a first-year conference. But the Kalahari can hold many more, so I expect this conference will grow next year. Especially if word gets out what a great job the organizers did.

That Conference home


Thursday, August 23, 2012 1:23:04 PM (GMT Daylight Time, UTC+01:00)
# Tuesday, August 21, 2012

Last week, Microsoft released Windows 8 and made it available to MSDN subscribers.

Recognizing that more applications will make this platform more successful, Microsoft is offering free help to developers who want to build applications for Windows 8.

You can sign up for the GenerationApp program to get guidance, including free access to Microsoft architects and consultants to advise you on everything from design to getting App Store approval. There are some limitations, so check out http://tinyurl.com/30daysWin8 for more information.

Tuesday, August 21, 2012 7:53:54 PM (GMT Daylight Time, UTC+01:00)
Tuesday, August 21, 2012 4:27:41 AM (GMT Daylight Time, UTC+01:00)