Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display of graph not always correct
Message
From
25/09/2006 10:38:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
25/09/2006 09:54:22
Judith Berry
Keystone Consulting Services, Inc.
Daleville, Indiana, United States
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01156895
Message ID:
01156917
Views:
22
(It has been a long time I didn't use MSGRaph and my suggestion might not help)
Instead of append general try directly changing MSgraph object's datasheet. ie:
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

> 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



>We are having a problem with a report that displays a graph of usage. We created the empty graph in a vfp 7 table. We then have to create a table with fields named on the past 12 months plus the current month. To do this we take the billing date and extrapolate the current billing month and year for the field names in the table. We recreate this table for each graph, because the billing date could be different for a each individual account. We then manuplate the "data" in the graph that is stored in the general field.
>
>The problem is that on occasion the graph will only show the blank graph on the report. This is sporadic and if the same billing cycle is used again then the individual accounts that had the blank graph on it will now show the correct usage history and different accounts will not show the graph.
>
>Here is a sample of the code used to generate this graph.
>
>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
>
>
>Any help or ideas as to why this happens will be greatly appreciated.
>
>
>Tim
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform