To download the CSP files from this tutorial, click TutorialSamples.zip. For more information, see Code examples.
<META HTTP
<!-- #include file=RetrieveIStore.csp -->
<!-- #include file=helper_js.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.
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.
ScheduleInfo = Obj.SchedulingInfo;
ScheduleInfo.IntervalHours = hours;
ScheduleInfo.IntervalMinutes = minutes;
//Indicate the report is to be scheduled hourly.
//Tell the APS to schedule the report.
function RedirectWithFrames(URL)
Response.Write ("<script language=javascript>open (\""+URL+"\",\"_top\");</script>");
var ReportID, CurrentFolderID, hours, minutes;
// Request the hours and minutes that the user entered on the
hours = Request.Form.Item("hours");
minutes = Request.Form.Item("minutes");
//Retrieve the report ID from the page's parameter list.
ReportID = Request.QueryString.Item("ReportID") ;
CurrentFolderID = Request.QueryString.Item("FolderID");
//Try to retrieve the InfoStore object.
//If it failed, redirect the user to the logon page.
RedirectWithFrames ("LogonForm.csp");
if ( ScheduleReport (IStore,ReportID,hours,minutes) == false )
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
// to the report details page.
Response.Redirect ("ReportDescription.csp
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |