|
最近在研究将整个td系统的多个domain的bug统计分析数据导出,但是发现tdfilter这个东西在平时使用的时候没有问题,但是在BuildSummaryGraph时就不起作用了
一下代码只要修改下地址,项目和用户名即可使用。
哪位朋友帮我在自己的td系统上试试看到底过滤有用么,结果可以参照bug系统的analysis ->summary返回的数据。
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
Set tdC = Nothing |
|