Hi experts,

I am able to generate a QC Test case execuiton report having defects linked in that report? I ahve written a macro which generates Excel file and provide me report of all the test sets executed with test case name and associated defects. Want to clarify that If I am linking Defect at Step level, then in report Ia m bale to see Defect linked with that particular test case. But If I am linking defect at direct test cases level, than that defect is not getting displayed in the report. How I can link Defect associated at test case level in my report. Following is the code snippet:-
Set tfact = tdc.TestSetFactory
Set tsTreeMgr = tdc.TestSetTreeManager
Set tcTreeMgr = tdc.TreeManager
nPath = "Root\" & Trim(qcTestSetFolderName)
Set TestSetFolder = tsTreeMgr.NodeByPath(npath)
Set TestSetF = TestSetFolder.TestSetFactory 'Retreive test from given folder in test lab
Set aTestSetArray = TestSetF.NewList("")
For i=1 to tsSet_cnt ' Loop through the Test Sets to pick the desired test Set
Set tstests=aTestSetArray.Item(i)
If TestSet_Name= qcTestSetName Then
Set TestCaseF = tstests.TSTestFactory 'Retreive Test Cases from the test set
Set aTestCaseArray = TestCaseF.NewList("")
tcCount = 1
Row = 2
For Each Tcase In aTestCaseArray
Sheet.Cells(Row, 1).Value = tcCount
Sheet.Cells(Row, 2).Value = Tcase.Name
Sheet.Cells(Row, 3).Value = Tcase.Field("TC_STATUS")
Sheet.Cells(Row, 4).Value = Tcase.Field("TC_ACTUAL_TESTER")
Set colDefectsLinked = Tcase.BugLinkFactory.NewList("")
'Msgbox colDefectsLinked.count ' Displays 1
For Each Defect in colDefectsLinked
With Defect
Set SourceObj = .SourceEntity
Set TargetObj = .TargetEntity
Set InitObj = .LinkedByEntity
'msgbox TypeName(SourceObj) & "=" & CStr(SourceObj.ID)
'msgbox TypeName(TargetObj) & "=" & CStr(TargetObj.ID)
'msgbox TypeName(InitObj) & "=" & InitObj.ID
'msgbox TargetObj.Summary
'msgbox TargetObj.Status
'msgbox TargetObj.AssignedTo
if (Sheet.Cells(Row, 5).Value <> "") then
Sheet.Cells(Row, 5).Value = Sheet.Cells(Row, 5).Value & "," & CStr(TargetObj.ID)
Sheet.Cells(Row, 5).Value = CStr(TargetObj.ID)
end if
if (Sheet.Cells(Row, 6).Value <> "") then
Sheet.Cells(Row, 6).Value = Sheet.Cells(Row, 6).Value & "," & CStr(TargetObj.Summary)
Sheet.Cells(Row, 6).Value = CStr(TargetObj.Summary)
end if
if (Sheet.Cells(Row, 7).Value <> "") then
Sheet.Cells(Row, 7).Value = Sheet.Cells(Row, 7).Value & "," & CStr(TargetObj.Status)
Sheet.Cells(Row, 7).Value = CStr(TargetObj.Status)
end if
if (Sheet.Cells(Row, 8).Value <> "") then
Sheet.Cells(Row, 8).Value = Sheet.Cells(Row, 8).Value & "," & CStr(TargetObj.AssignedTo)
Sheet.Cells(Row, 8).Value = CStr(TargetObj.AssignedTo)
end if
End With

Row = Row + 1
tcCount = tcCount + 1
End If