Project Users

 

 

User's Requirement

 

Ask for a button to extract the list of Project Users. The info will be:

  • Quality Center User
  • User Name
  • Telephone Number
  • E-Mail Address
  • Profiles

 

 

Proposed Solution

 

Creation of a button inside the Requirements Module that extract the requested data in EXCEL format.

If user has more profiles they will write in below cells without repeating general user informations.


 

 

____________________________________________________________________________

 

Implementation on the Product

 

Please refer to explanation on how to create a custom button that you can find in "Toolbar Button Editor" under WorkFlow Script Editor.

 

Suppose the action called from the button is actUsersList.

 

Steps:

  • Put inside the ActionCanExecute function the call to a main Sub in Requirements Module that we call Req_UsersList
  • Inside this Sub we'll use a property to return the list of all Project Users.
  • We also put the code to create the excel file and its header.
  • We'll do a cycle for each user to retrieve profiles informations and write them into the excel.

 

1. Code in ActionCanExecute

Function ActionCanExecute(ActionName)

On Error Resume Next

Dim Res

Res = True

    

     if ActionName = "actUsersList" then

        'Call of the Sub in Requirements Module

        Req_UsersList

     end if    

    

 

ActionCanExecute = Res

 

 

On Error Goto 0

End Function

 

 

2. Requirements Module. Main Sub

 

Sub Req_UsersList

On Error Resume Next

Dim ListaUtenti, i

Dim objXLS, objWkb, objWks

 

'create the UsersList Object

set ListaUtenti = TDConnection.Customization.Users.Users

 

'3. Creation of Excel Object

set objXLS = CreateObject("Excel.Application")

objXLS.Visible = False

Set objWkb = objXLS.Workbooks.Add
Set objWks = objWkb.Worksheets(1)

 

'Rename of 1st sheet

objWks.Name = "Utenti Progetto"

 

'Set the Header

objWks.Cells(1,1).Value = "Quality Center User"

objWks.Cells(1,2).Value = "User Name"

objWks.Cells(1,3).Value = "Tel Num"

objWks.Cells(1,4).Value = "E-Mail"

objWks.Cells(1,5).Value = "Profile"

 

'i is the row counter

i=2

 

'4. Cycle for all Users to retrieve infos

For Each Utente In ListaUtenti
            objWorksheet.Cells(i, 1).Value = Utente.Name
            objWorksheet.Cells(i, 2).Value = Utente.FullName
            objWorksheet.Cells(i, 3).Value = Utente.Phone

            objWorksheet.Cells(i, 4).Value = Utente.Email

 

             'Cycle for each group the user join to

             For Each Gruppo In Utente.GroupsList

                  'wirite info into excel file.

                  objWks.Cells(i, 5).Value = Gruppo.Name
                  i = i + 1
             Next    
Next

 

'save excel file. 

 

objWkb.SaveAs "c:\temp\ListaUtenti_" & split(date,"/")(2) & split(date,"/")(1) & split(date,"/")(0)

 

objWkb.Close

objXLS.quit

 

set objWks = Nothing

set objWkb = Nothing

set objXLS = Nothing

 

 

msgbox "UsersList Extraction Done", vbSystemModal + vbInformation, "Quality Center - UsersList"

 

On Error Goto 0

End Sub

 

 

Pag: <    >    >>