DestinationOptions.csp


<%@ Language=JavaScript%>

<%

// This file is called from ChooseDestination.csp.  Depending on which destination

// the user chose, this presents a form requiring details specific to the chosen destination.  Once

// the user has filled in the options, ScheduleToDestination.csp is called.

%>

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

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


<html>

<body>

<%



function PrintFTPOptions(ReportId)

// Print the options required to send the instance via FTP.

{

    Response.Write ("<H2>FTP Options</H2>");

    Response.Write ("<form action='ScheduleToDestination.csp?Destination=FTP&ReportId="+ReportId+"' method=post name='Schedule'>");

    Response.Write ("FTP Server: <input type=text name='ServerName'><BR>");

    Response.Write ("Port: <input type=text name='Port' value='21'><BR>");

    Response.Write ("Account Name: <input type=text name='AccountName'><BR>");

    Response.Write ("User Name: <input type=text name='UserName'><BR>");

    Response.Write ("Password: <input type=password name='Password'><BR>");

    Response.Write ("Path and filename: <input type=text name='FilePath'><BR>");

    Response.Write ("<BR><input type=submit name='Next' value='Schedule'>");

    Response.Write ("</FORM>");

}


function PrintPrinterOptions(ReportId)

// Print the options required to send the instance to a printer.

{

    Response.Write ("<H2>Printer Options</H2>");

    Response.Write ("<form action='ScheduleToDestination.csp?Destination=Printer&ReportId="+ReportId+"' method=post name='Schedule'>");

    Response.Write ("Printer name: <input type=text name='PrinterName'><BR>");

    Response.Write ("Copies: <input type=text name='Copies' value='1'><BR>");

    Response.Write ("From page (Enter zero for all): <input type=text name='FromPage'><BR>");

    Response.Write ("To page (Enter zero for all): <input type=text name='ToPage'><BR>");

    Response.Write ("<BR><input type=submit name='Next' value='Schedule'>");

    Response.Write ("</FORM>");

}


function PrintSMTPOptions(ReportId)

// Print the options required to send the instance via email.

{

    Response.Write ("<H2>SMTP Options</H2>");

    Response.Write ("<form action='ScheduleToDestination.csp?Destination=SMTP&ReportId="+ReportId+"' method=post name='Schedule'>");

    Response.Write ("SMTP Server: <input type=text name='ServerName'><BR>");

    Response.Write ("Port: <input type=text name='Port' value='25'><BR>");

    Response.Write ("Domain Name: <input type=text name='DomainName'><BR>");

    Response.Write ("Sender Address: <input type=text name='SenderAddress'><BR>");

    Response.Write ("Recipient Addresses (Separate with semi-colons): <input type=text name='RecipientAddresses'><BR>");

    Response.Write ("CC Addresses (Separate with semi-colons): <input type=text name='CCAddresses'><BR>");

    Response.Write ("Attachment name: <input type=text name='Attachment'><BR>");

    Response.Write ("Subject: <input type=text name='Subject'><BR>");

    Response.Write ("Body:<BR><TextArea name='Body'></TextArea><BR><HR>");

    Response.Write ("<H4>Authentication information</H4>This is optional if none is required.<BR>");

    Response.Write ("Authentication method:")

    Response.Write ("<select name='AuthenticationMethod'><option value='0'>None<option value='1'>PLAIN protocol<option value='2'>LOGIN protocol</select><br>");

    Response.Write ("User name:<input type=text name='UserName'><BR>");

    Response.Write ("Password: <input type=password name='Password'>");

    

    

    Response.Write ("<BR><input type=submit name='Next' value='Schedule'>");

    Response.Write ("</FORM>");

}


function PrintUnmanagedDiskOptions(ReportId)

// Print the options required to send the instance to the disk.

{

    Response.Write ("<H2>Unmanaged Disk Options</H2>");

    Response.Write ("<form action='ScheduleToDestination.csp?Destination=Disk&ReportId="+ReportId+"' method=post name='Schedule'>");

    Response.Write ("Path and filename: <input type=text name='FileName'><BR>");

    Response.Write ("<BR><input type=submit name='Next' value='Schedule'>");

    Response.Write ("</FORM>");

}


function Main()

// Depending on which destination the user selected, print a form with the

// correct destination options on it.

{

    

    var FTP=0;

    var SMTP=1;

    var Disk=2;

    var Printer=3;

    IStore = RetrieveIStore();

    if (IStore == null)

    {

        Response.Redirect("Start.csp");

        return;

    }

    Destination = Number(String(Request.Form.Item("Destination")));

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

    switch(Destination)

    {

        case FTP:

            PrintFTPOptions(ReportId);

            break;

        case SMTP:

            PrintSMTPOptions(ReportId);

            break;

        case Disk:

            PrintUnmanagedDiskOptions(ReportId);

            break;

        case Printer:

            PrintPrinterOptions(ReportId);

            break;

    }

}


Main();

%>

</body>

</html>





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