User's Requirement
Ask for a button to extract the list of Project Users. The info will be:
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:
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
Questo sito è stato realizzato con Jimdo! Registra il tuo sito gratis su https://it.jimdo.com