Now that you have the InfoObject for the unmanaged disk destination, you can use the PluginInterface to set the scheduling options that are specific to Disk. These include only the complete path and filename of the instance.
DiskSchedulingOptions = Disk.PluginInterface("").ScheduleOptions;
DiskSchedulingOptions.DestinationFiles.Add(1,"C:\MyReports.rpt");
Once the Disk options are set, you must copy them into the Report.ScheduleInfo.Destination. This will cause the instance to be transferred to the required directory with the required file name after it has been processed. For example:
Report.SchedulingInfo.Destination.SetFromPlugin (Disk);
You are now ready to schedule the report using the InfoStore. The complete example for scheduling via unmanaged disk is given below. You can now choose to go to:
function ScheduleToDisk(IStore,ReportId, FilePath)
var Reports = IStore.Query("SELECT SI_ID, SI_NAME FROM CI_INFOOBJECTS WHERE SI_ID="+ReportId);
//Create an interface to the scheduling options for the report.
ScheduleInfo = Report.SchedulingInfo;
Disk = IStore.Query("Select Top 1* From CI_SYSTEMOBJECTS Where SI_PARENTID=29 and SI_NAME='CrystalEnterprise.DiskUnmanaged'").Item(1);
DiskSchedulingOptions = Disk.PluginInterface("").ScheduleOptions;
DiskSchedulingOptions.DestinationFiles.Add(1,FilePath);
ScheduleInfo.Destination.SetFromPlugin (Disk);
//Tell the APS to schedule the report.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |