Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
No replies
SystemAdmin
SystemAdmin
5301 Posts
ACCEPTED ANSWER

Pinned topic Reduce attributes list to type

‏2013-02-08T10:08:26Z |
Hello,

can someone test the following code:


Set oReqTypes = oProject.ReqTypes   aTyps = Array() 
' atyps = Array("elh", "eph", "eds", "eut", "eit", "esr") aTyps = Array(
"elh", 
"eph")   For Each sTyp In aTyps 
' Debug.Print sTyp   Set oReqs = oProject.GetRequirements(sTyp, eReqsLookup_TagPrefix, eReqWeight_Heavy)   
' With Workbooks("reqpro_lesen.xls").Sheets("Tabelle1") 
'  .Cells(1, 1).Value = "Tag" 
'  .Cells(1, 2).Value = "Text"   For Each oreqtype In oReqTypes For Each oReqAttr In oreqtype.Attrs 
'  .Cells(1, j).Value = oReqAttr.Label & " - " & oreqtype.Name Debug.Print oReqAttr.Label & oreqtype.Name   Next Debug.Print 
"----" Next   i = 2 For Each vkey In oReqs Set oreq = oReqs.Item(vkey) 
'  .Cells(i, 1).Value = oReq.Tag 
' .Cells(i, 2).Value = oReq.Text   
'   Debug.Print oreq.Tag & " "; oreq.Text; " " Set cAttrVals = oreq.AttrValues   For Each oAttrVal In cAttrVals 
'    .Cells(i, j).Value = oattrval.Text 
'   Debug.Print " " & oAttrVal.Text   Next   Next 
'  End With Debug.Print 
"---" Next


I would like to display the attributes only of the type that is actual in the array.

But reqtypes does not accept a parameter ? I am a bit confused with the data structure of reqpro and need help.

There is a second option to get the Type: described in the ReqPro help with title:
"Modyfying Requisite Attribute Values", using the Requirement.AttrValues Property

However, this is on requirement level, and I want to print the attribute label only once as header, not for every req.

Timo