I have the below code to reschedule the reports in BO using SDK. But I am not able to do it. The below code just rescheudles the report, but the mail is not sent as per the existing schedule.
Code and scheduled description given below. Any quick pointers are highly appreciated.
<%@ page import = "com.crystaldecisions.sdk.occa.infostore.*" %>
<%@ page import = "com.crystaldecisions.sdk.framework.CrystalEnterprise" %>
<%@ page import = "com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import = "com.crystaldecisions.sdk.framework.IEnterpriseSession" %>
<%
// logon information
String boCmsName = "***" ;
String boUsername = "***" ;
String boPassword = "***" ;
String boAuthType = "secEnterprise" ;
// report
String reportName = "SDK_TEST" ;
// logon
IEnterpriseSession ceSession = CrystalEnterprise.getSessionMgr().logon( boUsername, boPassword, boCmsName, boAuthType ) ;
IInfoStore oInfoStore = (IInfoStore)ceSession.getService( "", "InfoStore" ) ;
IInfoObjects oInfoObjects = oInfoStore.query("select top 1 * from ci_infoobjects where SI_NAME='" + reportName + "' " );
IInfoObject oI = (IInfoObject) oInfoObjects.get(0);
IInfoObject oSched = (IInfoObject) oInfoObjects.get(0);
oSched.getSchedulingInfo().setRightNow(true);
oSched.getSchedulingInfo().setType(CeScheduleType.ONCE);
oInfoStore.schedule(oInfoObjects);
%>
Title: SDK_TEST
Document Type: Web Intelligence Report
Status Success
Destination: Default
Owner: ****
Creation Time: 5/15/2014 1:53 AM
Start Time: 5/15/2014 1:53 AM
End Time: 5/15/2014 1:53 AM
Duration: 3 sec
Server Used: mdwnew.AdaptiveJobServer
PID: 27131966
Parent Object Path: **********
Remote Instance in Federated Cluster: No
Expiry: 5/15/2024 1:53 AM
Formats: Web Intelligence
Now my doubt is can we reschedule the report directly or we need to get all the scheduling info like from/to/events etc and then apply them for the new schedule? I think it will be a tedious job as it could be SMTP or FTP or inbox or anything.