Dim tdCon
Dim tdGraph
Dim tdAnalysis
Dim tdDefectFac
server = "http://192.168.5.122/tdbin"
project = "网络"
domain = "系统"
user = "z"
pass= ""
Set tdc = CreateObject("tdapiole80.tdconnection")
tdc.InitConnectionEx (server)
tdc.ConnectProjectEx domain ,project,user,pass
Set tdDefectFac = tdc.BugFactory
Dim tdFilter
Set tdFilter = tdDefectFac.Filter
'tdFilter.Filter("BG_STATUS") = "Not Cancel And Not Closed And Not Deferred And Not Tracking And Not Migrated And Not Scheduled"
'过滤条件在BuildSummaryGraph时不起作用,无论怎么设定都是返回全部数据
tdFilter.Filter("BG_STATUS") = "Open"
tdFilter.Filter("BG_DETECTION_DATE") = "2009-10-30"
Set tdGraph = tdDefectFac.BuildSummaryGraph("BG_DETECTED_BY", "BG_STATUS",None,0 , tdFilter,False,False)
For i = 0 To tdGraph.RowCount - 1
'Sheet1.Cells(i + 2, 1) =
debug.Writeline tdGraph.RowName(i)
Next
For j = 0 To tdGraph.ColCount - 1
'Sheet1.Cells(1, j + 2) =
Debug.WriteLine tdGraph.ColName(j)
Next
For i = 0 To tdGraph.RowCount - 1
For j = 0 To tdGraph.ColCount - 1
'Sheet1.Cells(i + 2, j + 2) = tdGraph.Data(j, i)
Debug.WriteLine "(" & tdGraph.RowName(i) & "," & tdGraph.ColName(j) & ") -> " & tdGraph.Data(j, i)
Next
Next
If tdC.Connected Then
If tdC.ProjectConnected Then
tdC.DisconnectProject
End If
tdC.ReleaseConnection
End If