Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
*!* Now create the spreadsheet
oExcel = CREATEOBJECT([Excel.Application])
WITH oExcel
*!* .Visible = .T. && Do while testing, remove in live app
.workbooks.add
*!* Put data in first sheet
.Sheets([Sheet1]).Select()
.ActiveSheet.Cells(1, 1).Select()
*!* Get the data and paste it in
SELECT Temp1
counter = 1000
oldcounter = 0
loopcnt = 2 && added to make space for the headers each pasting has
DO WHILE counter <= RECCOUNT()
SELECT * FROM temp1 WHERE recno() > oldcounter and recno() <= counter INTO CURSOR temp3
_Vfp.DATATOCLIP( , , 3)
.ActiveSheet.Paste()
.ActiveSheet.Cells((counter + loopcnt), 1).Select()
SELECT temp1
DO CASE
CASE counter < RECCOUNT() - 1000
oldcounter = counter
counter = counter + 1000
CASE counter < RECCOUNT()
oldcounter = counter
counter = RECCOUNT()
OTHERWISE
counter = RECCOUNT() + 1
ENDCASE
loopcnt = loopcnt + 1
ENDDO
*!* Put data in second sheet
.Sheets([Sheet2]).Select()
.ActiveSheet.Cells(1, 1).Select()
SELECT Temp2
counter = 1000
oldcounter = 0
loopcnt = 2
DO WHILE counter <= RECCOUNT()
SELECT * FROM temp2 WHERE recno() > oldcounter and recno() <= counter INTO CURSOR temp3
*!* Get the data and paste it in
_Vfp.DATATOCLIP( , , 3)
.ActiveSheet.Paste()
.ActiveSheet.Cells((counter + loopcnt), 1).Select()
SELECT temp2
DO CASE
CASE counter < RECCOUNT() - 1000
oldcounter = counter
counter = counter + 1000
CASE counter < RECCOUNT()
oldcounter = counter
counter = RECCOUNT()
OTHERWISE
counter = RECCOUNT() + 1
ENDCASE
loopcnt = loopcnt + 1
ENDDO
*!* Save and close
.ActiveWorkbook.SAVEAS (_ccFile)
.ActiveWorkbook.CLOSE()
ENDWITH
oExcel.Quit()
oExcel = .NULL.
RELEASE oExcel