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)
.
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)
.
.
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.