ASP.NET Samples
    .NET Application Samples
    Reporting Services Samples

    View The Latest
OfficeWriter Docs

    OfficeWriter Home
    OfficeWriter Resources
    OfficeWriter Demos

Welcome to OfficeWriter v3.5 ASP.NET Samples

About ASP.NET samples

The OfficeWriter ASP.NET are listed on this page. Each report demo is implemented as an ASP.NET Page class. The visual elements appear on the web form and the OfficeWriter code that is responsible for generating the report can be found in the CodeBehind class.

Clicking "View source" on any of the demo pages listed below will display the CodeBehind class for that demo.

Run samples from the web

All ASP.NET samples are hosted on SoftArtisans servers for you to test and view. Follow the links below to run the online samples.

ExcelApplication Samples

Basic Steps
(C#) (VB.NET)
Demonstrates new v3.5 feature: Conditional Formatting
This demo shows a wide range of ExcelApplication functionality in one place.  If you are new to ExcelWriter or looking to brush-up your basic skills, start by reviewing the code for this demo. Also demonstrate Conditional Formattion (new in OfficeWriter v3.5)
Basic Steps R1C1
(C#) (VB.NET)
New v3.5 Sample: R1C1 Formula Notations
This sample is similar to the BasicSteps sample, except that it uses the new R1C1 formula parser. All cell formulas, range declarations, and chart data sources are defined in R1C1 notation.
Data Validation
(C#) (VB.NET)
New v3.5 Sample: Data Validation
Excel Data Validation (in Excel the menu, Data > Validation...) allows you to control what kind of data can be entered into cells by creating validation rules. You can define and apply these rules with ExcelApplication.
Excel to Web Demo
(C#) (VB.NET)
New v3.5 Sample: Publish Excel data to the web
Extract Excel data into a DataTable and bind it to a DataGrid control. Demonstrates how you can easily take data from an Excel workbook and put it onto the web.
Sales Commission Report
(C#) (VB.NET)
Compare last year's and this year-to-date sales commission payouts for the sales team.
Grouping & Subtotals
(C#) (VB.NET)
Display nested product category sales data. Detail rows for each category are shown in collapsible lists with subtotal formula rows.
Multi-Chart Report
(C#) (VB.NET)
Import data to an existing workbook with multiple charts. Manipulate the existing charts with ExcelApplication.
Scatter Chart Report
(C#) (VB.NET)
OfficeWriter support many types of Excel charts, including Scatter charts.
Application-To-Template Demo
(C#) (VB.NET)
Dynamically create an ExcelTemplate-compatible workbook by programmatically writing data markers into a workbook with ExcelApplication.
Template-To-Application Demo
(C#) (VB.NET)
Demonstrates how to populate a template workbook with ExcelTemplate, and then programmatically manipulate the populated workbook with ExcelApplication. Using ExcelTemplate and ExcelApplication objects together can be a powerful technique that allows you to combine the flexibility and ease of a template-based design approach with the power of a full Excel API.
Two Axis Chart Demo
(C#) (VB.NET)
Create a two-axis chart with ExcelApplication.

ExcelTemplate Samples

Arrays & Collections as Data Sources
(C#) (VB.NET)
Demonstrates new v3.5 feature: System.Collections support
ExcelTemplate can import data from standard .NET arrays, and also objects from the System.Collections namespace. This sample demonstrates how to use many standard data objects such as string[], ArrayList, and Hashtable.
Chart Report
(C#) (VB.NET)
ExcelTemplate can be used with Excel charts of all types.  If the chart references a dynamic range of data that is imported by ExcelTemplate, the chart references are automatically updated by ExcelTemplate without any additional coding.
Database Import Demo
(C#) (VB.NET)
With as little as five lines of ExcelTemplate code, you can import data from a database into an Excel report.
Data Marker Options Demo
(C#) (VB.NET)
Demonstrates new v3.5 feature: "Preserve" data marker modifier
Demonstrates the various options and switches that can be used with data markers in ExcelTemplate template workbooks.
Sample Expense Report
(C#) (VB.NET)
This demo uses ExcelTemplate to populate a generic expense report template.
Loan Calculator Spreadsheet
(C#) (VB.NET)
Enter loan information into the boxes below to see a fully amortized loan calculation in Excel.  ExcelWriter allows you to preserve your existing investment in Excel design and calculation while bringing your reports to the web.
String Data Source
(C#) (VB.NET)
This is a very basic demo of using two strings as the data source for an Excel report.
XML Data Import Demo
(C#) (VB.NET)
With ExcelTemplate, you can import data from virtually any source.  This demo shows how to parse an XML file and put the data into arrays for use in an ExcelTemplate report.

WordApplication Samples

Product Catalog Demo
(C#) (VB.NET)
An AdventureWorks2000 Product Catalog with formatting, tables, lists, nested data, and images.
Search & Replace Demo
(C#) (VB.NET)
New v3.5 sample: Search and Replace
New in WordWriter v3.5, you can easily search Word documents by using powerful Regular Expression patterns and easily replace text. This sample demonstrates how to use the new Search & Replace functionality
Sales Report Demo
(C#) (VB.NET)
Demonstrates usage of the WordApplication and WordTemplate objects together. Generates a nested-data sales report from AdventureWorks2000 data.
Form Letter Formatting Demo
(C#) (VB.NET)
New v3.5 sample: Modify WordTemplate reports with WordApplication
Generate a form letter with WordTemplate, then use WordApplication to change the font and font size based on the user's selection. This sample demonstrates new Template-To-Application functionality.
Watermark Demo
(C#) (VB.NET)
New v3.5 sample: Dynamically add Watermarks to documents
Dynamically place custom watermarks on a Word document using the WordApplication object.
Merge Documents Demo
(C#) (VB.NET)
New v3.5 sample: Copy and merge fragments from different documents
New in WordWriter v3.5, you can now insert elements from separate documents. You can use this functionality to copy/paste document elements into different files, or to easily merge Word documents. This sample demonstrates how to merge three different Word documents into one unified document.

WordTemplate Samples

Basic String Datasource
(C#) (VB.NET)
This is a basic demo that inserts data into a template document that has two merge fields.
Calendar Demo
(C#) (VB.NET)
Create a calendar document for any month/year combination.
Business Envelope
(C#) (VB.NET)
WordTemplate Envelope Demo
Fax Cover Sheet
(C#) (VB.NET)
A fax cover sheet with recipient and sender information, created by WordTemplate.
Form Letter Demo
(C#) (VB.NET)
Generate a form letter with WordTemplate.
Mail Merge Demo
(C#) (VB.NET)
Emulate a Word mail merge using WordTemplate. A document will be created with each recipient's letter on a new page. Take care of all of your mail merge production with one print job.
Purchase Order
(C#) (VB.NET)
A generic purchase order document with a header section and an expanding Word table for detail rows.
Mailing Labels Demo
(C#) (VB.NET)
This demo reads customer data from a database and creates standard-sized 5160 mailing labels. Put some label paper into your printer and see for yourself!
Insert Image Demo
(C#) (VB.NET)
WordTemplate can insert images into Word documents at runtime. Image data can come from a byte array or ADO.NET DataColumn.

HotCell Technology Samples

Excel Web Form Demo
(C#) (VB.NET)
Update employee information in a server-side database through HotCell-enabled Excel workbook.
Excel Drill Down Sample
(C#) (VB.NET)
Use HotCells to "Drill Down" through several layers of relational data from an Excel workbook.

Downloading and running on your computer

Follow these steps to run the OfficeWriter sample code in your own machine or development server:

  • Verify database requirement - Many of the OfficeWriter samples demonstrate how to import data from a database into an Excel or Word report. All .NET samples that connect to a database use the ADO.NET System.Data.SqlClient namespace to connect to Microsoft SQL Server and the AdventureWorks 2000 sample database.

    If you do not have the AdventureWorks 2000 database on your SQL Server you can download it here. If you do not have the required database, the samples that do not use databases will still work.

  • Download samples Zip file - Samples are distributed in a Zip file. Use the following links to download:

    Unzip the contents to any location on your disk.

  • Create IIS virtual application folders - Visual Studio .NET web projects require that the root directories be configured as IIS virtual applications before opening the project. Create an application for both root folders in the zip.

  • Open projects and rebuild - Open either the OfficeWriter for Excel or OfficeWriter for Word .csproj or .vbproj files (depending on whether you chose C# or VB.NET) in Visual Studio .NET. Samples zips are distributed without OfficeWriter product assemblies. You need to add a reference to the OfficeWriter assemblies (SAXW6NET.dll for Excel, SAWW3NET.dll for Word). Find the assemblies in the OfficeWriter install folder. Rebuild the Visual Studio .NET projects.

  • Run the samples - You are now ready to run the samples locally. Open a browser and navigate to one of the virtual directories you just created.





Copyright 2005 © SoftArtisans, Inc. All Rights Reserved.