Click to Rate and Give Feedback
Related Articles
Learn how to create a workflow that uses InfoPath forms and other office documents for passing data to targeted activities and for use in Office documents.

By Rick Spiewak (June 2008)
See how to build a document-level Visual Studio Tools for Office customization and integrate it with a content type in SharePoint.

By Steve Fox (May 2008)
Learn how to automate custom SharePoint application deployments, use the SharePoint API, and avoid the hassle of custom site definitions.

By E. Wilansky, P. Olszewski, and R. Sneddon (May 2008)
Editor-in-Chief Howard Dierking explains why it's wise to consider Microsoft Office a development platform, even though developers typically don't.

By Howard Dierking (May 2008)
More ...
Articles by this Author
Host a wiki the easy way, get the screen shots you need and mark them up, and read about LINQ this month in Toolbox.

By Scott Mitchell (July 2008)
This month test your web site on many platforms and browsers without setting up a test environment, use mock objects for unit testing, and visit Raymond Chen.

By Scott Mitchell (June 2008)
This month the Toolbox column takes a look at database logging, Joel Spolsky's blog, printing code projects, and ASP.NET reading.

By Scott Mitchell (May 2008)
See how to log Web application errors for better health monitoring, what to read if you’re thinking about LINQ, and which blog Scott recommends reading this month.

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

By Scott Mitchell (March 2008)
This month, more of the tools you need to get your job done.

By Scott Mitchell (December 2007)
This time: Windows Forms grids, professional-looking date textboxes, file merging, and more.

By Scott Mitchell (November 2007)
This month's products include DatabaseSpy, FileZilla, NCache, and more.

By Scott Mitchell (October 2007)
More ...
Popular Articles
Kenny Kerr sings the praises of the new Visual C++ 2008 Feature Pack, which brings modern conveniences to Visual C++.

By Kenny Kerr (May 2008)
OBA solution patterns help architects and developers build Office Business Applications (OBAs). This article introduces the seven core OBA solution patterns and applies one to a real-world problem.

By Steve Fox (March 2008)
Mike Volodarsky demonstrates the IIS 7.0 extensibility model by extending the Response Modification into a configurable Web server module and a custom management page for IIS Manager.

By Mike Volodarsky (Launch 2008)
Howard Dierking talks to the inventor of C++, Bjarne Stroustrup, about language zealots, the evolution of programming, and what’s in the future of programming.

By Howard Dierking (April 2008)
More ...
Read the Blog
Windows Presentation Foundation (WPF) offers excellent support for managing the display and editing of complex data. In the December 2007 edition of MSDN Magazine, John Papa did a great job of explaining essential WPF data binding concepts. ...
Read more!
The most fundamental form of Web testing is HTTP request/response testing. This involves programmatically sending an HTTP request to the Web application, fetching the HTTP response, and examining the response for an expected value. In the May 2008 issue of MSDN Magazine, Read more!
In the November issue of MSDN Magazine, Jeffrey Richter demonstrates some recent additions to the C# programming language that make working with the APM significantly easier. In the June ...
Read more!
The July 2008 issue of MSDN Magazine is now available online. Here's what's in the issue: Data Services: Develop ...
Read more!
The June 2008 issue features the first installment of a new MSDN Magazine column on software design fundamentals. We’ll discuss design patterns and principles in a manner that isn't bound to a specific tool or lifecycle methodology. In this issue, Jeremy Miller starts the Patterns in Practice column ...
Read more!
In the April 2008 issue of MSDN Magazine, Kenny Kerr introduced the Windows Imaging Component (WIC), showing you how you can use it to encode and decode different image ...
Read more!
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