给你一段代码看看吧.(在form中要先添加一个oldboundcontrol的控件)sele pdate as month,&ldispfld;
     from tmp_costcal1;
     where tmp_costcal1.prodno==allt(thisform.kftextbox1.value) .and. tmp_costcal1.pdate>date()-5*30;
     into cursor tmp_costcal2
sele tmp_costcal2
lgdata=""
scan
  lgdata=lgdata+chr(9)+str(month(month),2)+"月"
endscan
lgdata=lgdata+chr(13)+chr(10)
for lfcount=2 to fcount()
  lgdata=lgdata+field(lfcount)
  scan
    lvar=field(lfcount)
    lgdata=lgdata+chr(9)+allt(str(&lvar.,10,2))
  endscan
  lgdata=lgdata+CHR(13)+CHR(10)
endfor
creat cursor tmp_graph (graph g)
sele tmp_graph
appe blan
appe general graph data lgdata  class "msgraph.chart"
thisform.oleboundcontrol1.controlsource="tmp_graph.graph"