ScheduleWithValues.csp

<%@ Language=JavaScript%>

<!-- #include file="RetrieveIStore.csp" -->

<!-- #include file=helper_js.csp -->


<%

function Main()

{

    var IStore;

    IStore = RetrieveIStore();

    if (IStore == null)

    {

        Response.Redirect ("Start.csp");

        return;

    }

    var Result;

    ID = Request.QueryString.Item("ReportID");

    Email = Request.Form.Item("Email");

    

    Result = IStore.Query("Select SI_NAME, SI_ID From CI_INFOOBJECTS Where SI_ID=" + ID);

    if (Result.Count == 0)

    {

        Response.Write ("No reports could be found to schedule.");

        return;

    }

    

    var ScheduleInfo ;

    //Create an interface to the scheduling options for the report.

    ScheduleInfo = Result.Item(1).SchedulingInfo;

    // Run the report once.

    ScheduleInfo.Type = 0;

    // Run it right now.

    ScheduleInfo.RightNow = true;

    

    //Add the email address to the InfoObject's property bag.

    //This will be stored in the Instance as well.

    Result.Item(1).Properties.Add ("Email", String(Email));

        

    //Tell the APS to schedule the report.

    IStore.Schedule (Result);

    Response.Write ("The report has been scheduled with the custom value. Open <a href='GetUsersInstancesForm.csp'>GetUsersInstances.csp</A> to search for all instances with a particular email address, or schedule another instance using <a href='GetUserDetails.csp'>GetUserDetails.csp</A>.");

}


Main();


        

%>




Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com