Each user account in Crystal Enterprise is represented by an InfoObject. These objects are stored in CI_SYSTEMOBJECTS in the APS InfoStore and are marked with the programmatic identifier, "CrystalEnterprise.User". The InfoObject that represents the user also has an interface to the User Plugin, which gives it its specific behavior. Like other InfoObjects, user objects are uniquely represented by their ID property. You can query for a list of users using the InfoStore. For example, the following query selects the names, full names, and IDs of all user accounts in the APS:
var Users = IStore.Query("SELECT SI_ID, SI_NAME, SI_USERFULLNAME FROM CI_SYSTEMOBJECTS WHERE SI_PROGID='CrystalEnterprise.USER'");
The Query method returns a collection of InfoObjects, which in this case are User accounts. You access the properties of a user account in a manner similar to which you access other InfoObject properties.
This prints the name, ID, and full name of the first user found from the query.
Response.Write (Users.Item(1).ID);
Response.Write (Users.Item(1).Title);
Response.Write (Users.Item(1).PluginInterface("").FullName);
The Title, which is synonymous with SI_NAME, and the ID can be retrieved directly because they are standard InfoObject properties. SI_USERFULLNAME, however, is specific to a user account, andas with specific propertiesmust be retrieved using the plugin interface.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |