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

Contents
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