Once you have the name and description (optional) of the group, you add a new group in much the same way that you add any other object such as a report. The basic steps in creating a new object are:
var PluginMgr = IStore.PluginManager;
var UserGroupPlugin = PluginMgr.Plugininfo("CrystalEnterprise.UserGroup");
var NewInfoObjects = IStore.NewInfoObjectCollection();
NewInfoObjects.Add (UserGroupPlugin);
var NewUserGroup = NewInfoObjects.Item(1);
NewUserGroup.Description = Description;
IStore.Commit (NewInfoObjects);
The UserGroup plugin is retrieved by passing the plugin's ProgID (CrystalEnterprise.UserGroup) to the PluginInfo property of the PluginManager. When setting the properties for the new group, a single method is used.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |