当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: http://www.zjw.gov.cn/ ......
 ·两个ado的问题。up有分    »显示摘要«
    摘要: 1. //操作sql server数据库 _recordsetptr pirecordset; ... cstring strsql="select * from stationset where stationid=00 order by paraid"; pirecordset->open(_variant_t(strsql),vnull,adopendyna......


如何用VB导出Excel图表(eg:饼图,柱图)

假设RecordSet中已经有内容,怎样根据里面的字段导出Excel图表?(我是新手)

NO.1   作者: lihonggen0

引用Microsoft   Excel   x.0

宏代码:  
   
   
          Range("A1:B2").Select  
          Charts.Add  
          ActiveChart.ChartType   =   xlColumnClustered  
          ActiveChart.SetSourceData   Source:=Sheets("Sheet1").Range("A1:B2"),   PlotBy:=   _  
                  xlRows  
          ActiveChart.Location   Where:=xlLocationAsObject,   Name:="Sheet1"  
          With   ActiveChart  
                  .HasTitle   =   False  
                  .Axes(xlCategory,   xlPrimary).HasTitle   =   False  
                  .Axes(xlValue,   xlPrimary).HasTitle   =   False  
          End   With  
 

NO.3   作者: sunmaoyou

先把数据转化到Excel中,  
  有关生成图的代码:  
    Dim   ex   As   excel.Application  
    Dim   Ct   As   Object  
   
           
          Set   ex   =   CreateObject("Excel.Application")  
          打开工作表  
          Set   newbook   =   ex.Workbooks.Open(App.Path   &   "\a.xls")  
                  增加工作表  
          ex.Workbooks.Add  
   
   
   
   
          Set   Ct   =   ex.Worksheets("sheet1").ChartObjects.Add(0,   280,   350,   250)  
                Ct.Chart.ChartWizard   Source:=ex.range("A1:C6"),   _  
                  gallery:=xlLine,   HasLegend:=False,   Title:="流程压力变化曲线"  
                   
                  With   ex.Worksheets("sheet1").ChartObjects(1).Chart  
                                  .ChartArea.Font.Size   =   8  
                                  .ChartArea.Font.ColorIndex   =   7  
                                  .HasDataTable   =   True  
                                  .DataTable.HasBorderOutline   =   True  
                                  .DataTable.ShowLegendKey   =   True  
                        With   .ChartTitle.Font  
                                  .Size   =   10  
                                  .Color   =   RGB(0,   255,   0)  
                                  .Bold   =   True  
                                  .Background   =   xlBackgroundTransparent  
                          End   With  
                           
                  End   With  
 


 ·关于formula one的问题    »显示摘要«
    摘要: 请问:现在formula one的最新版本是多少?有无相应中文版?有无关于formula one编程方面的书籍?有没有朋友能弄到一套formula one?有偿提供也可以。 ......
» 本期热门文章:
· 热门栏目:
» 相关精选文章
» 其它相关:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE