ChooseServer.csp


<%@ Language=JavaScript%>

<%

// This file is the first page in the example. It shows a drop down

// list populated with all servers connected to the APS and allows the

// user to choose one.  It then calls ShowServerStatus.csp to display

// the status of the server and allows the user to start, stop, restart,

// enable or disable the server.

%>

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

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

<html>

<body>

<%

    

function GetServers(IStore)

{

    // This function returns a listbox popuplated with all servers connected to the APS and all APS's.

    

    var Servers = IStore.Query("SELECT SI_ID, SI_NAME FROM CI_SYSTEMOBJECTS WHERE SI_PROGID='CrystalEnterprise.Server'");

    if (Servers.Count == 0)

    {    

        return "";

    }

    var k;

    var HTMLTable="<select name=ServerId>";

    for (k=1;k<=Servers.Count;k++)

    {

        HTMLTable = HTMLTable + "<option value='"+Servers.Item(k).Id+"'>"+Servers.Item(k).Title;

    }

    HTMLTable= HTMLTable + "</select>";

    return HTMLTable;

}



function Main()

{

    IStore = RetrieveIStore();

    if (IStore == null)

    {

        Response.Redirect ("Start.csp");

        return;

    }

    Response.Write ("<H2>Server administration</H2>");

    Response.Write ("<form action='ShowServerStatus.csp' method=post name='Server'>");

    Response.Write ("Choose the server that you want to control.<BR>");

    Response.Write ("Server: <BR>");

    Response.Write (GetServers(IStore));

    Response.Write("<HR>");

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

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

}


Main();

    

%>

</body>

</html>




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