Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating EXCEL or WORD Reports with Headers

Status
Not open for further replies.

stlrain95

Programmer
Sep 21, 2001
224
0
0
US
Is there a way to create a report in excel or word that have pre-defined column headers?

Currently just copy fields to type xls in the code.

Thanks,
 
It isnt possible with direct foxpro commands, like the one you mentioned, but you may be able to by creating a foxpro report and saving(exporting?) it to excel, it might do what your aksing.

The other alternative would be to access Excel via ActiveX and create the excel sheet, populate it and modify the header/footer from there. i.e. myexcel = CreateObject("excel.application").


Stephen

 
The best way is to manipulate the excel object model. If you create and object with say
loExcel = CreateObject("excel.application")

then you can control almost anything that is available in Excel through VBA. If you are using VFP 7 with its excellent Intellisense, you could try this out in the command window and once you have what works, you can paste the code in your method or prg.

remeber that is you want to see what is happening, you would have to issue
loExcel.visible=.t.

and release it with loExcel=""

Hope this helps
 
I don't have a problem creating the object, but I need to open an existing sheet in a directory that have pre-formed headers. Then I need to place the contents of the table into this sheet.

Any ideas?
 
You need to start reading up on Office and Excel Automation. Also check out the help files for VBA under Excel.

Stephen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top