The following properties are related to the scheduling of an InfoObject. They are mostly concerned with how, where, and when the InfoObject will be processed. Most of these properties are set through the SchedulingInfo object, and they are all contained in the SI_SCHEDULEINFO property bag. To retrieve the values of these SchedulingInfo object properties from the result set of a query, you must query for SI_SCHEDULEINFO first.
SELECT SI_ID FROM CI_INFOOBJECTS WHERE SI_ID = 123 AND SI_SCHEDULEINFO.SI_SUBMITTER = 'WRichards'
The following example retrieves the scheduling information for all of the reports in the system:
QueryResult = InfoStore.Query ("Select SI_SCHEDULEINFO From CI_INFOOBJECTS Where SI_PROGID='CrystalEnterprise.Report'")
StartTime = QueryResult.Item(Index).SchedulingInfo.BeginDate
It is better to limit the number of objects that need to be retrieved. For example, you could request a single report:
QueryResult = InfoStore.Query("Select SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_NAME in ('Report1')
ReportId = QueryResult.Item("Report1").ID
QueryResult = InfoStore.Query ("Select SI_SCHEDULEINFO, SI_NAME From CI_INFOOBJECTS Where SI_ID = " & ReportId)
StartTime = QueryResult.Item(Index).SchedulingInfo.BeginDate
For more information on optimizing your queries, see Performance issues.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |