Introduction
  Welcome
  The Web Reporting Solution
  What is ExcelWriter?
  Features and Benefits
  New in This Version  V4
  Requirements
  Edition Differences
  Frequently Asked Questions
  Troubleshooting

Quick Start
  Creating Your First Spreadsheet
  Adding a Formula
  Adding Formatting
  Importing from a Database

Features In Depth
  Addressing Cells
  Setting Values
  Output Options
  Adding Charts
  Reading an Existing Spreadsheet
  Modifying an Existing Spreadsheet
  The Range Object
  Template Spreadsheets
  How to Use Templates
  ExcelApp.Open vs. ExcelTemplate
  Using ExcelTemplate with PivotTables
  Templates and Charts
  Reliable Spreadsheet Download  V4
  Page Setup
  Formatting Headers & Footers
  Protecting your Worksheet
  Multilingual Support  V4
  XML Import

HotCell Technology  V4
  What is HotCell Technology?
  Upload Example
  Advanced POST Example
  Advanced Upload Example

Programmer's Reference
  Object Model
      ExcelTemplate Object
      ExcelApplication Object
         3DProperties Object
         Area Object
         Axis Object
         Cells Object
         Cell Object
         Charts Object
         Chart Object
         ChartFrame Object
         Font Object
         Line Object
         PageSetup Object
         Pictures Object
         Picture Object
         Range Object
         SeriesCollection Object
         Series Object
         Style Object
         Worksheets Object
         Worksheet Object
  Formula Functions
  Formula Calculation Operators
  Formatting Codes
  Chart Codes

Installation
  Quick Installation
  Configuring IIS
  Security Considerations

External Links
  ExcelWriter Home Page
  Technical Support
  ExcelWriter Demos
  SoftArtisans Home Page
  E-mail General Questions
  E-mail Technical Support
  Legal Information

Setting Values


Methods for Assigning Cell Values

Cell values can be assigned,
  • Programmatically, on a cell-by-cell basis with data that has been parsed from a CSV file or an XML file
  • By iterating through an ADO Recordset and assigning field values to cells on a row-by-row basis
  • By importing a recordset in a single step with CopyFromRecordset or GetDataFromRecordset*
  • By importing a recordset in a single step using ExcelTemplate
  • By copying data from an existing Excel file into the newly created Excel sheet using GetDataFromExcelSheet*
  • By opening* an existing Excel file, and saving it with a new name

ExcelWriter allows you to format these imported cell values as virtually any data type that are supported by Excel. This includes currency, date/time, numeric data types such as integer or floating point number, strings, text, etc. Casting (or changing cell values from one data type to another) can be accomplished by means of the server-side scripting functions (i.e. VBScript's CStr() or CINT() functions).

* This feature is not available in ExcelWriterSE, ExcelWriterLE, and ExcelWriterFree.

Top


Example 1: Data Types

Microsoft Excel supports many different types of data in a cell: integer and floating point numbers, text, date/time, currency. The following example shows a broad range of different data types.

features/value1.asp

[View Source]

You'll note that the formatting is independent of the value. This example purposefully does not set formatting - it illustrates that you may need to set formatting depending on the type of data such as dates or currency.

Top


Example2: Changing from One Type to Another

The previous example showed how to enter values with default interpretation by ExcelWriter. It is also possible to explicitly convert one type into another - a process known as casting.

features/value2.asp

[View Source]

Top


Section Summary

  1. It is simple to set cell values using ExcelWriter defaults.
  2. Using casting, ExcelWriter defaults can be overridden.

Top


Copyright © 2003, SoftArtisans, Inc.