To download the CSP files from this tutorial, click TutorialSamples_vb.zip. For more information about using the samples, see Code examples.
<META HTTP
<!-- #include file=RetrieveIStore.csp -->
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.
Dim ReportID, CurrentFolderID, Hours, Minutes
'Request the hours and minutes that the user entered on the
Minutes = Request.Form("Minutes")
'Retrieve the report ID from the page's parameter list.
ReportID = Request.QueryString("ReportID")
CurrentFolderID = Request.QueryString("FolderID")
'Try to retrieve the InfoStore object.
If RetrieveIStore(IStore)= FALSE Then
'If it failed, redirect the user to the logon page.
Response.Redirect "LogonForm.csp"
If ScheduleReport (IStore,ReportID,Hours,Minutes) = FALSE Then
Response.Write "There was an error and as" & _
" a result I could not schedule this report."
'If the scheduling was successful then send the user back
Response.Redirect "ReportDescription.csp
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |