Methods for Assigning Cell ValuesCell values can be assigned,
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. Example 1: Data TypesMicrosoft 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. 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. Example2: Changing from One Type to AnotherThe 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. Section Summary
Copyright © 2003, SoftArtisans, Inc. |