Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code for excel model
Message
From
11/11/2005 03:46:15
 
 
To
10/11/2005 11:39:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01067207
Message ID:
01067548
Views:
16
Hi Velayutham,

You can have look at my rep2excel tool here in downloads
It is class having all bunch of wrappers for common excel writing tasks.

You can manipulate/write xls file using simple 2D and 3Dd positioning shemes, using simple method calls like ;
oXL=createobject('excel_file_automation')
oXL.open_instance(cTemplateXLSFile) && or from scratch
.
** Writing 
oXL.make_cell(nSheet,nRow,nCol, myValue)
oXL.table_in_section(nSheet,nRow,nCol,'myAlias','field1|field2|||field-n')
oXL.array_in_section(nSheet,nRow,nCol, @myAraay)
.
.

**Simple Graphics
oXL.draw_box(2,2, 20,20)
oXL.paint_box(2,2, 20,20, nColorNumber)
oXL.l_h_single(22,2, 22, 20)
oXL.insert_picture(nSheet,nRow,nCol, cFile)
.
.
Also, there are various wrappers for setting formulas , fonts , formating cells, merging cells, setting print area etc.

*** Output.xls file destination is preset via property to 'C:\windows\desktop' which is way outdated nowdays so, pls amend that property (or entire saving method) to output some place else where you can see/use it...
Source and samples are included.

There is also article in last Foxpro Advisor, written by Walter Savinovich
presenting similar aproach. Perhaps there is some code to download from there as well, if you are subscriber.

Rgds+++
Sergio


>I just need a small code sample to do the following from VFP program: To create an Excel
>file with a single sheet, fill cells with some data from my dbf, apply colors and fonts
>to cells. Other features of Excel (like setting formulas) are not required. I do not
>want to use the command COPY TO .. TYPE XLS. Can anybody help me? Thanks in advance.
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Previous
Reply
Map
View

Click here to load this message in the networking platform