It's always great to be recognized for doing a great job or helping someone out. That was the original idea behind Microsoft's MVP (Most Valuable Professional) program. In Microsoft's (collective) mind when they created the program, the trenches of the development newsgroups was the place where help was performed best, so decisions regarding MVP program admission were based almost completely on how much you contributed to those newsgroups.

While I have the utmost respect for those developers that so graciously offer their time and expertise to others through the newsgroups, there are many other ways in which an individual can make great contributions to the Microsoft development community. Some of these ways include running a community-oriented Web site, starting a user group, writing articles, and speaking at user groups and conferences. All of these activities (and several others) combine to make the Microsoft developer community one of the strongest in the world. It is only fitting that everyone that makes a significant contribution to the Microsoft developer community be awarded the MVP status, without bias toward any particular medium of communication.

I'm very happy to report that this year Microsoft has seen the light and is awarding MVP status to a whole new segment of community leaders. Yours truly is among the new MVPs, but I think that the most significant new MVPs are many of the .NET user group leaders (think INETA). These people spend a great deal of their time organizing meetings and evangelizing .NET development. I think that it is wonderful that Microsoft recognizes these (often overlooked) individuals for their efforts. This recognition may also encourage others to start .NET user groups in their areas.

Now that Microsoft has rightfully expanded the available criteria for MVP nominations, though, I think that it is important that they not let the program get out of control. The number of developers that have certifications such as MCSD and MCAD has reached a point of saturation where it really doesn't carry much value anymore. I don't want to see the MVP status suffer a similar fate. Luckily, Microsoft reviews the MVP status each year, so this program is well-suited to "trimming the fat," so to speak. This is a transition year so there will likely be many more MVPs than there really should be. Going forward, Microsoft should set a quota on the number of MVPs that they maintain each year. This number shouldn't be so small that it is exclusionary, but it shouldn't be easy to get in, either. As with the college or job application process, Microsoft should look for those individuals that are well-rounded, contributing to the Microsoft development community in two or more different ways.

I'm sure that this article will generate some hate mail from existing MVPs who only contribute to the newsgroups and who were happy with the way things used to be, but thinking that way just doesn't make sense anymore (if it ever did). The very essence of the award itself (Most Valuable Professional), suggests that admission to the program must be extremely competitive. If you need a real world analogy, consider professional sports. Everybody in a given professional sports league is pretty darn talented, but only the best get to play in the all star game. In the case of the MVP program, I think that increasing the competition will be good for the development community because individuals who want to make the cut will seek out more opportunities to help others (either directly or indirectly). Let down your guard, and you may not get a trip to the MVP Summit next year (as it should be).

Repeat Offender

I often find myself in situations where I need to generate simple reports for an ASP.NET Web application. Sometimes I use a DataGrid control, but I usually end up using a Repeater because it offers ultimate flexibility. One common problem I encounter while creating reports is how to effectively deal with the display of duplicate data items. For instance, a report of the orders for Canada contained in the Northwind database displayed in a simple Repeater might look like Figure 1. You can see that there is a lot of redundant data in the Employee Name and Company Name fields. You could read the report much more easily if you group the data logically with redundant data stripped out, as in Figure 2.

Figure 1: A lot of redundant data.
Figure 2: The redundant data is stripped out.

The trick to removing duplicate items from templated controls lies in keeping track of which item is being currently rendered and comparing it with the previous item to look for duplicate data. This trick is pretty difficult to manage using just embedded template code in your ASPX page, so it is much easier to call from your Repeater control's ItemTemplate into a generic GetNoRepeatField function exposed by your code-behind class (Listing 1).

The GetNoRepeatField function accepts two parameters. The fieldIndex parameter specifies where the value parameter belongs in the report's hierarchy (Listing 2). You need to declare a static string array named "values" with as many elements in it as you are going to track in your report hierarchy. In the case of the Orders report, the code strips out duplicate data items for the first two columns, Employee Name and Company Name. We'll initialize the string array with two items. You need a static array so that it keeps its state across multiple calls to the GEtNoRepeatField function.

Next you need to determine if the item being passed into the function is the same as the item stored in the "values" string array. If it is, you'll return an empty string out of the function. If the value is not a match, then you need to store the new value in the "values" string array. Then you'll blank out each element in the "values" string array that has an index greater than the one you're currently working with. Why do this? Because if a parent level of a report changes, then all children of that report level need to be reset. Finally, return the value passed into the function as its result so that it gets displayed to the screen.

As you can see, this simple technique enables you to eliminate all of the duplicate data elements in your ASP.NET reports. It is also applicable to DataGrids or any of the other templated server controls, if you prefer to use them. Once you put this code into action, the end users of your Web application will definitely appreciate the cleaner, more elegant appearance of your reports.