Hi all,
I'm in the process of learning how to export information to excel but came across an issue that I can seem to resolve.
I have a table ("Testtable") with 4 records (4 rows and 5 columns) see image below
In VFP9 im running this code;
The code above opens up Excel with the following data on it;
The code i'm using only grabs what's stored in row 1 on the table. I can't figure out how to get the rest of the data to excel. Im using this approach because I need add format the excel with more data like Name of the company, address, phone number etc..
Any help/suggestions will be greatly appreciated.
Thank you
I'm in the process of learning how to export information to excel but came across an issue that I can seem to resolve.
I have a table ("Testtable") with 4 records (4 rows and 5 columns) see image below
In VFP9 im running this code;
Code:
local oExcel, oSheet
oExcel = CreateObject("Excel.Application")
oExcel.Visible = -1 && for debugging
oExcel.Workbooks.Add()
oSheet = oExcel.ActiveSheet
oSheet.cells(1,1).Value = "Name of Company"
oSheet.cells(2,1).Value = orderdate
oSheet.Cells(2,2).Value = line
oSheet.Cells(2,3).Value = item
oSheet.Cells(2,4).Value = customer_number
The code above opens up Excel with the following data on it;
The code i'm using only grabs what's stored in row 1 on the table. I can't figure out how to get the rest of the data to excel. Im using this approach because I need add format the excel with more data like Name of the company, address, phone number etc..
Any help/suggestions will be greatly appreciated.
Thank you