Click to Rate and Give Feedback
Related Articles

Windows SharePoint Services (WSS) 3.0 provides a new and improved infrastructure for handling server-side events. In this installment of Office Space, we look at techniques for hooking up Before Events and After Events using both Features and code.

Ted Pattison

MSDN Magazine November 2007

...

Read more!

See how to build a document-level Visual Studio Tools for Office customization and integrate it with a content type in SharePoint.

Steve Fox

MSDN Magazine May 2008

...

Read more!

See how to use Word to capture a VBA macro and use Visual Studio Tools for Office to wrap it up into a deployable Word add-in.

Robert Bogue

MSDN Magazine May 2008

...

Read more!

Learn how to enable an auditing solution for Windows SharePoint Services (WSS) 3.0 with customized control pages in Microsoft Office SharePoint Server (MOSS) 2007.

Ted Pattison

MSDN Magazine September 2008

...

Read more!

Our site manager Mike Richter leverages Virtual Earth, the Microsoft MapPoint Web service, and Visual Studio to automate the creation of a Web site for his future nuptials and to manage the guest list.

Michael Richter

MSDN Magazine October 2007

...

Read more!

Also by this Author

This month the Toolbox column takes a look at database logging, Joel Spolsky's blog, printing code projects, and ASP.NET reading.

Scott Mitchell

MSDN Magazine May 2008

...

Read more!

This month, a better design-time experience for Web apps, Scott Guthrie's blog, extending Extend Lutz Roeder's Reflector, and more.

Scott Mitchell

MSDN Magazine March 2008

...

Read more!

Now that you're even managing projects in the cloud, you'll need some tools to help. This month we illustrate one, discuss UX design patterns, a book by Anders Hejlsberg, and more.

Scott Mitchell

MSDN Magazine June 2009

...

Read more!

This month we look at rich data Web controls for AJAX, HTTP traffic analysis, and more.

Scott Mitchell

MSDN Magazine March 2009

...

Read more!

If you want to apply static analysis to your databases, connect to remote computers, find out more about the Entity Framework, or just check into some cool podcasts for your daily commute, then you'll want to read more about these latest tools and resources.

Scott Mitchell

MSDN Magazine July 2009

...

Read more!

Popular Articles

Here we introduce you to some of the concepts behind the new F# language, which combines elements of functional and object-oriented .NET languages. We then help you get started writing some simple programs.

Ted Neward

MSDN Magazine Launch 2008

...

Read more!

One-time passwords offer solutions to dictionary attacks, phishing, interception, and lots of other security breaches. Here's how it all works.

Dan Griffin

MSDN Magazine May 2008

...

Read more!

C# allows developers to embed XML comments into their source files-a useful facility, especially when more than one programmer is working on the same code. The C# parser can expand these XML tags to provide additional information and export them to an external document for further processing. This article shows how to use XML comments and explains the relevant tags. The author demonstrates how to set up your project to export your XML comments into convenient documentation for the benefit of other developers. He also shows how to use comments ...

Read more!

Jeff Prosise explains when it's better to use UpdatePanel and when it's better to use asynchronous calls to WebMethods or page methods instead.

Jeff Prosise

MSDN Magazine June 2007

...

Read more!

A Sidebar gadget is a powerful little too that's surprisingly easy to create. Get in on the fun with Donavon West.

Donavon West

MSDN Magazine August 2007

...

Read more!

Toolbox
Generate Office Documents, Monitor Event Logs, and More
Scott Mitchell

Create Native Word and Excel Docs
Most data-driven Web sites are used as interfaces to collect, process, and summarize information. Reports that summarize the data can be presented to the user in a variety of formats—the most common way is to display the report directly in a Web page. However, in some scenarios Microsoft® Excel® and Word documents are a more ideal format. If the report is stored as an Excel document, for example, a user can easily e-mail it to a colleague, make her own modifications to the data, sort and filter the data without having to re-request the report from the Web site, and so on.
Generating Word and Excel documents on a Web server can be accomplished in a variety of ways. One option is to use the Office Web Components (OWC), which are a collection of COM components for generating Excel spreadsheets and charts. While OWC allows for creating more feature-rich Excel documents, it requires that Microsoft Office be installed on the Web server and introduces performance and scalability concerns.
In short, efficiently generating feature-rich Office documents in a server-side environment requires that you create the raw, binary version of the Office document on the server using simple file creation techniques. This approach offers the best of both worlds: native documents can be created with the full set of Office features, yet there's no requirement to have Office installed on the server.
OfficeWriter version 3.5, by SoftArtisans, allows for both Excel and Word documents to be created in this manner. With OfficeWriter, you start by creating an Excel or Word template on your desktop computer. The templates contain placeholders that indicate where the dynamic data will be placed. In addition, these templates can contain the full set of Office features and capabilities. Spreadsheet templates, for example, can include charts, pivot tables, formulas, macros, multiple sheets, and so on. When the template is complete, just upload it to the Web server and create an ASP.NET page that binds data to the template. This will create a new Excel or Word document, mashing together the data and template.
  
OfficeWriter allows for a variety of data sources to be bound to the underlying template, including results from a database query, and the resulting Office document can be saved to the Web server's file system or streamed to the client. OfficeWriter also provides integration with SQL Server™ Reporting Services, allowing for reports to be designed directly from within Word and for generated reports to be exported as Word documents or enhanced Excel spreadsheets.
Price: $1,495 per server for the Standard Edition.

Monitor Your Event Logs
The Windows® Event Log serves as a centralized repository for security, system, and application-level information. While the Event Log contains information of interest primarily to system administrators (for example, failed login attempts, disk errors, unexpected shutdowns, and so on), it also contains database and application errors that concern developers. When these errors occur on production servers, it's important that the responsible developers are alerted immediately.
There are a number of products designed for system administrators to provide monitoring of the Event Log and notifications. One such tool is Event Sentry version 2.70, by NETIKUS.NET, which offers an easy-to-use, yet powerful interface for receiving notification when certain conditions are met in the Windows Event Log. Event Sentry provides filters that allow for only specific event conditions to trigger a notification. The filterable criteria include the event source, the event ID, the event severity, and the event text, among others.
  
You can also set a threshold indicating that you only want to be notified if an event occurs a certain number of times, like twice in the span of five minutes. Once a filter's criteria are met, a notification is generated. Event Sentry supports 12 forms of notification, including RSS feeds, sending e-mail, starting a process or script, and recording the results to a database or file.
For example, you might be using the Enterprise Library's ExceptionHandling feature to log unhandled exceptions to the server's Event Log with the Source "My Application". If you'd like to receive an e-mail notification when your application raises an unhandled exception, simply create a filter that looks for events from the "My Application" Source. Next, add an e-mail notification, specifying the SMTP server to use and the recipient list. Henceforth, any unhandled exceptions in your application will result in an e-mail notification in your Inbox!
Price: $69 per server (with discounts for multiple licenses).

Using Source Control to Track Changes
Every software company, whether it has one developer or teams of hundreds, should be using some form of source control. However, far too many one-developer companies, or companies whose primary business line is not in software, simply don't use source control. Such shortsightedness is trouble looking for a place to happen.
Microsoft has long offered developers Visual SourceSafe® as a source control tool. With Visual Studio® 2005 Team System, Microsoft has released another source control tool—one designed for supporting much larger developer teams. Despite these offerings, there is still a healthy third-party source control market. One such third-party tool is Vault from SourceGear LLC.
  
Like any source control tool, Vault facilitates storing source code in a centralized repository; maintains a history of code changes; allows for check out, modify, check in, and modify and merge workflows; offers branching and merging of source control trees; and so on. It was also designed with Visual SourceSafe users in mind. Vault will happily import your existing Visual SourceSafe database, and the check out, modify, check in workflow can be performed entirely through the Visual Studio IDE, just as with SourceSafe.
Unlike Visual SourceSafe, Vault uses Microsoft SQL Server as its centralized data store, making it easy to schedule backups, run queries directly against the source code repository, and so on. (Vault also offers a set of API libraries that allow you to programmatically access the repository.)
Vault was designed to work over the Internet, which is a boon for developers like myself who telecommute or work for remote clients. By simply installing Vault on a Web server, developers scattered around the globe can work on a project together. The requests to the repository hosted on the Web server are transparently handled via HTTP or HTTPS requests through the Vault client.
For those solo developer shops, there's absolutely no excuse not to be using source control as SourceGear offers a free single-user license. If you find yourself working on code without a source control tool in place, consider preventing that problem waiting to happen by using Vault.
Price: $289 per developer license.

The Bookshelf
In a September, 2004 column for the MSDN Web site, Eric Sink coined the term micro-ISV (Independent Software Vendor). As Eric describes it, a micro-ISV is one that is very small, "a company with less than 50 employees..., funded by its own revenues, and has not accepted investment from a venture capitalist." The majority of micro-ISVs were initially started as and continue to run as one-man (or one-woman) shops.
Many developers have fancied the notion of ditching their day job to pursue building and selling their own software product, but they don't know where or how to get started. Part of the challenge of starting a micro-ISV is that there's so much more to it than simply writing the next killer app.
  
If dreams of starting your own micro-ISV have floated through your head, check out Micro-ISV: From Vision to Reality (APress, 2006). In it, Bob Walsh explores the core challenges faced by micro-ISVs. The first hurdle to overcome is to have a well-defined idea for an application that solves a real customer's real pain. A product that doesn't solve a real problem or doesn't have a clear vision is one that's destined to fail. There are also unique challenges for micro-ISVs when designing the application.
In the corporate setting, rarely is a lone developer responsible for designing the user interface, crafting the application's architecture, deciding on the programming methodologies to be used, choosing the development tools, and writing all of the code. But as a micro-ISV, many, if not all, of those responsibilities and choices will fall squarely on your head. Deciding on a product and building it are just the first steps for a micro-ISV. There's still the much more important aspect: convincing people to pay for your product.
The many interviews sprinkled throughout the book provide a gamut of information including advice from successful micro-ISV founders with tips on envisioning, designing, developing, and marketing your product; discussions with payment processing Web sites on the options and challenges of accepting customer payments online; great productivity tips; and food for thought from an attorney regarding partnership and liability issues that businesses must consider. These interviews greatly enhance the information presented throughout this book, and the advice from successful micro-ISV founders serves as a source of inspiration.
Price: $29.99

Scott Mitchell, author of numerous books and founder of 4GuysFromRolla.com, is an MVP who has been working with Microsoft Web technologies since 1998. Scott is an independent consultant, trainer, and writer. Reach him at Mitchell@4guysfromrolla.com or via his blog at ScottOnWriting.NET.

Page view tracker