SchedulingInfo
object to gain access to the report's scheduling options.
Note: The scheduling options in this tutorial allow you to generate report instances. However, if a report includes parameters or requires the user to log on to a database, the instance may fail or not return the desired report information unless you add more advanced functionality to the scheduling page. This is because scheduling uses the parameter and database logon information that is currently stored with the report object. If you want to change the report's parameter and logon information, you must use the ReportParameter Object and ReportLogon Object.
Function ScheduleReport(IStore, ReportID, Hours, Minutes)
'This function schedules a report.
'IStore - The InfoStore object that allows us to query.
'ReportID - The ID of the report that is to be scheduled.
'Hours - How often the report should be scheduled in hours.
'Minutes - How often the report should be scheduled in minutes.
'The function returns TRUE if successful and FALSE otherwise.
'Query for the report's scheduling options.
Set Result= IStore.Query( "Select SI_SCHEDULEINFO From CI_INFOOBJECTS Where SI_ID="&ReportID)
'Check that you have an object.
'Retrieve the report from the InfoObjects collection.
'Create an interface to the scheduling options for the report.
Set ScheduleInfo = Obj.SchedulingInfo
ScheduleInfo.IntervalHours = Hours
ScheduleInfo.IntervalMinutes = Minutes
'Indicate the report is to be scheduled hourly.
'Tell the APS to schedule the report.
This section of code queries for the report's SI_SCHEDULEINFO collection, giving you access to the SchedulingInfo
object's properties and methods. Note that when changes are made through the SchedulingInfo
object, they are actually being made to the SI_SCHEDULEINFO collection. This makes it possible for the InfoStore to write the changes back to the server using the original result set from the query.
The SchedulingInfo
object reveals a myriad of different scheduling options of which only the most basic are used in this tutorial. For more information on the scheduling options available when using this object, see SchedulingInfo Object.
You've reached the end of the lesson. What follows is Schedule.csp, a file that includes the ScheduleReport
function that you just looked at. To learn how to schedule reports that contain parameter values, see .
Lesson 3e: Building a Report Details page
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |