[ Home ] [ Features ] [ Products ] [ FAQ's ] [ Screens ] [ Support ] [ Downloads ] [ About ] [ Discussion ]


the software that grows with you

 

V32Excel()

Invokes Excel and displays a two-dimentional array as an active sheet given the column headings.

Syntax

V32Excel( <aData>, <aColHeadings>, <aColInfo> )

Arguments

aData A two dimentional array of data comprising rows and columns. Each column must have the same type of data for each row. Data type can be one of the following:
Character Numeric Date Logical
aColHeadings A one dimentional array of character strings comprising headings of columns corresponding to len( <aData[ 1 ]> ). Default will be null string means no heading will be displayed above the column data.
aColInfo A two dimentional array corresponding columns in <aData> with the following information: 
cHdgFont Font to be used to display column heading. Default is Courier.
nHdgFontSize Font size to be used to display column heading. Default is 16.
nHdgFontColor Numeric color index (see below for possible values) to be used by <cHdgFont> to display heading. Default is 0 = Auto.
nHdgIntColor Numeric color index (see below for possible values) to draw interior of the heading cell. Default is 0 = Auto.
cDtaFont Font name to be used to display data of column. Default is Courier.
nDtaFontSize Font size to be used to display data in column. Default is 12.
nDtaFontColor Numeric color index (see below for possible values) to be used by <cColFont> to display data. Default is 0 = Auto.
nDtaIntColor Numeric color index (see below for possible values) to draw interior of the data cells Default is 0 = Auto.
lDtaBold Logical to display column data in bold face. Default is FALSE. 
lDtaItalic Logical to display column data as italicised. Default is FALSE. 
lDtaUnderline Logical to display column data as underlined. Default is FALSE. 
cColAlign Character string of one byte to indicate the alignment property of column data. It can be 'R'- Right, 'L'-Left or 'C'-Center. By default numeric data is displayed right aligned and all other types left aligned.

Returns

NIL

Description

This function is object independent and invokes Excel with data provided as a two-dimentional array. Rows in array will be displayed vertically as 1,2,3,...n and columns horizontally as A,B,C, ... N. Optionally an array of column headings may be supplied which will be displayed above the column data. Moreover display behaviour of columns can be controlled with optional two-dimentional array of information (see above).

Note that numeric data must be formatted to same decimal places for a given column, otherwise, the display behaviour will be inconsistent. Numeric data will be aligned to the right by default. But you can force it to be displayed as you like.

Usage

function Array2Excel()

local aData := {}
local aHeadings := {}
local aInfo := {}
local dSet 

dSet := Set( _SET_DATEFORMAT, 'dd/mm/yyyy' )

aadd( aData, { 'Ron Pinkas' , 'XHarbour' , 0.73 , .t. , ctod( '03/09/01' ) } )
aadd( aData, { 'Roger Donnay' , 'Express++' , 2.00 , .t. , ctod( '10/02/00' ) } )
aadd( aData, { 'Andrew Wos' , 'What32' , 1.00 , .t. , ctod( '05/05/02' ) } )
aadd( aData, { 'Victor K.' , 'PDF Library' , 0.70 , .t. , ctod( '11/07/02' ) } )

aHeadings := { 'Author', 'Library', 'Ver', 'Avl', 'Published' }

V32Excel( aData, aHeadings )

Set( _SET_DATEFORMAT, dSet )

return nil

Tips

Color Indexes Used by Excel:
Black 1 White 2 Red 3 Green 4
Blue 5 Yellow 6 Pink 7 Turquoise 8
Dark Red 9 Dark Green 10 Dark Blue 11 Dark Yellow 12
Violet 13 Teal 14 Gray 50 15 Gray 25 16

 

[ Home ][ Features ] [ Products ][ About Us ][ FAQ's ][ Screen Shots ][ Downloads ][ Support ][ Discussion ]
.

Vouch is a Trademark of Pritpal Bedi
All other Trade Marks are the property of their respective owners.
Copyright 1993-2011 Pritpal Bedi. All rights reserved.
Hit Counter  
You are Visitor # since 14 May 2002