StandardProfile.AccessControlList
This property returns the AccessControlList object which specifies which users and groups can access this Standard Profile.
| Syntax | Parameters | Return Value |
|---|---|---|
| - | - | AccessControlList |
SVB Example
Data Entry Example 7: Adding a report:
Sub Main
Dim oOM As ObjectManager
'Reconnect into Enterprise
Set oOM = New ObjectManager
oOM.Reconnect Application
'Create the report
Dim myReport As OutputMonitor
Dim myReportInfo As New MonitorCreateInfo
myReportInfo.Folder = "/Blake's Materials"
myReportInfo.MonitorType = swcOutputMonitor
myReportInfo.AuditLogReason = "Adding a report for the Bread Charts"
myReportInfo.Name = "Bread Report"
Set myReport = oOM.Monitors.AddEx(myReportInfo)
myReport.AutoSave = False
'Add an analysis configuration to the report
myReport.Component.Add(oOM.Monitors.Item("/Blake's Materials/Bread Charts"))
'Set its schedule, starting on February 28, 2017
myReport.ScheduleInfo.StartDate = #2/28/2017#
'Schedule it by week, to run at 7:00 PM (the "19" value below),
'running only on Monday, Wednesday, and Friday (the "1,3,5" value).
'Refer to OutputMonitorScheduleInfo.ScheduleString for an explanation of this syntax.
myReport.ScheduleInfo.ScheduleString = "0 19 * * 1,3,5"
'Note: to make it run on demand, set ScheduleString to an empty string.
'Set permissions to be the same as the data entry setup that it is based upon.
Dim breadDataEntrySetup As StandardProfile
Set breadDataEntrySetup = oOM.Profiles("/Blake's Materials/Bread Measurements")
Dim i As Long
Dim permissionItem As AccessControlItem
'Iterate through the items in the DE Setup's permissions list.
'If an item is a user, then add it to the report's users.
'If it's a group, then add it to the report's groups.
'Note that we set the edit mode of the items that we add to the report
'based on the "CanEdit" property of the item from the DE Setup.
For i = 1 To breadDataEntrySetup.AccessControlList.Count
Set permissionItem = breadDataEntrySetup.AccessControlList.Item(i)
If permissionItem.IsUser Then
myReport.AccessControlList.AddUser(permissionItem.Name, permissionItem.CanEdit)
Else
myReport.AccessControlList.AddGroup(permissionItem.Name, permissionItem.CanEdit)
End If
Next
'Set the output options
Dim reportOutputInfo As New ReportOptionInfo
reportOutputInfo.Open(Application, myReport.ReportLayout)
'We will send the output to an HTML report and the printer
reportOutputInfo.ReportAction = swcReportAction_File + swcReportAction_Print
reportOutputInfo.OutputFile = "C:\temp\Bread Report.htm"
reportOutputInfo.LaunchAssociatedApplication = True
myReport.ReportLayout = reportOutputInfo.ReportLayout
'Save our output changes
Dim reportUpdateInfo As New MonitorUpdateInfo
reportUpdateInfo.AuditLogReason = "Setting report's output and scheduling"
myReport.SaveEx(reportUpdateInfo)
oOM.Disconnect
'The report is now ready to be edited interactively.
'In Enterprise, select the report and click "Edit Report" to format
'it, and then save it. At this point, you can run the report.
End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.
