>local ix >with thisform.myGraph.object.application.datasheet > .Cells.Clear > for ix=1 to fcount() && Field names as header > .Cells(1,m.ix).Value = field(m.ix) > endfor > scan > for ix=1 to fcount() > .Cells(recno()+1,m.ix).Value = evaluate(field(m.ix)) > endfor > endscan >endwith >>Cetin
>>DO WHILE .NOT. EOF() >>ACCTN=acct >>k=12 >>k1='12' >>L1=bdate-28 >>L3=DTOC(L1) >>L2=SUBS(L3,4,2) >>M=ALLTRIM(STR(YEAR(L1))) >>M=SUBSTR(M,4,1) >>M1=ALLTRIM(STR(YEAR(L1)-1)) >>M1=SUBSTR(M1,4,1) >>L=CMONTH(L1) >>L=CMONTH(L1) >>j=CMONTH(L1) >> DO WHILE k>0 >> IF k=1 >> con&k1=SUBS(L,1,3)+'O'+M1 >> jc=SUBS(L,1,3)+'O'+M >> ELSE >> con&k1=SUBS(L,1,3) >> ENDI >> k=k-1 >> k1=ALLTRIM(STR(k)) >> L1=L1-VAL(L2) >> L=CMONTH(L1) >> L3=DTOC(L1) >> L2=SUBS(L3,4,2) >> ENDDO >> SELECT xzextra >> IF USED("timtest") >> USE IN timtest >> ENDIF >> IF FILE("timtest.dbf") >> DELETE FILE timtest.dbf >> endif >> >> *!* create table field name based on calendar months and year >> CREATE TABLE TIMTEST ; >> ( acct N(10), &CON1 N(10), &CON2 N(10), &CON3 N(10), &CON4 N(10), &CON5 N(10), &CON6 N (10),&CON7 N(10), &CON8 N(10), &CON9 N(10), &CON10 N(10), &CON11 N(10), &CON12 N(10), &jc N(10)) >> >> SELECT billwe >> *!* get historical data to populate amounts to show on graph >> ACCTN=acct >> m.WCON=WCON >> SCATTER FIELDS acct,conw1,conw2,conw3,conw4,conw5,conw6,conw7,conw8,conw9,conw10,conw11,conw12,conw13 MEMVAR >> SELE TIMTEST >> APPE BLANK >> REPL acct WITH M.acct >> REPL &CON1 WITH M.conw12 >> REPL &CON2 WITH M.conw11 >> REPL &CON3 WITH M.conw10 >> REPL &CON4 WITH M.conw9 >> REPL &CON5 WITH M.conw8 >> REPL &CON6 WITH M.conw7 >> REPL &CON7 WITH M.conw6 >> REPL &CON8 WITH M.conw5 >> REPL &CON9 WITH M.conw4 >> REPL &CON10 WITH M.conw3 >> REPL &CON11 WITH M.conw2 >> REPL &CON12 WITH M.conw1 >> REPLACE &jc WITH M.WCON >> c=FCOUNT("timtest") >> #DEFINE cr CHR(13) >> #DEFINE TAB CHR(9) >> >> SELECT TIMTEST >> cGraphString = "" >> * Build tab-delimited string of field names: >> FOR iCounter = 1 TO c >> cGraphString = cGraphString + FIELDS(iCounter) ; >> + IIF(iCounter < c,TAB,cr) >> ENDFOR >> * Concatenate the data, converting numeric fields to character: >> SCAN >> >> FOR iCounter = 1 TO c >> cGraphString = cGraphString + IIF(TYPE(FIELDS(iCounter))='C',; >> EVALUATE(FIELDS(iCounter)) ; >> ,STR(EVALUATE(FIELDS(iCounter)),16,2)); >> + IIF(iCounter < c,TAB,cr) >> ENDFOR >> ENDSCAN >> SELECT billwe >> APPEND GENERAL OLEGRAPH2 DATA cGraphString>>