Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member184995
Active Contributor
0 Kudos

A customer asked for information on how to update the binary stream maximum size for the web intelligence server.  I had not heard of this setting so upon investigation discovered that it was possible using the Enterprise SDK.

Binary Stream Maximum Size (MB)

This is the maximum size of a binary file (for example: *.pdf, *.xls) that can be transferred from one module to another. If a binary file generated from a Web Intelligence document is greater than this limit, the generation is stopped to protect the server and an error is returned.

Increase this limit if the server has to generate large binary files (for example, if InfoView users view large documents in .pdf format).

Default: 50 MB

Range: 1 to 65535 MB

When setting this value, it is stored until the webi server is restarted so there are two methods that can be used to get this value.getBinStreamMaxSizeUpdate() is used to get the value after you have set it but BEFORE you have restarted the server.getBinStreamMaxSize() is used to get the actual current value that the webi server is running against.Then of course there is the setBinStreamMaxSizeUpdate(int size) which allows you to update the size and after doing so you restart the server.The following code shows how to set this value and then restart the webi server.  Values are hard coded so you will need to make the appropriate changes for your system.There have been changes in XI 3.x. Some methods have been deprecated and the way you go about updating parameters has changed.  I will show how to do this in both XI R2 and XI 3.1.Setting the binary stream maximum value size using XI R2

<%
<textarea cols="75" rows="10">
<%@ page import = "com.crystaldecisions.sdk.plugin.desktop.server.,
                com.crystaldecisions.sdk.occa.enadmin.*,
                com.crystaldecisions.sdk.plugin.admin.cmsadmin.*,
                com.crystaldecisions.sdk.plugin.desktop.common.*,
                com.crystaldecisions.sdk.framework.*,
                com.crystaldecisions.sdk.exception.*,
                com.crystaldecisions.sdk.occa.infostore.*,
                com.crystaldecisions.sdk.occa.security.*,
                com.businessobjects.sdk.plugin.admin.webiserveradmin.*"
%>

    //Declare logon variables
    String user = "administrator";
    String password = "Password123";
    String cms = "DEVR3SP3";
    String cmsAuthType = "secEnterprise";

    IServer currentServer = null; //Server object returned from InfoStore
    IWebiServerAdmin webiAdmin = null; //Interface to webi admin
    boolean commandSuccess; // a boolean variable to retrieve the result of the manageServer() method

    try{//Logon and Query CMS for
        IEnterpriseSession es = null;
        es = CrystalEnterprise.getSessionMgr().logon( user, password, cms, cmsAuthType);
        IInfoStore iStore = (IInfoStore) es.getService("", "InfoStore");
        currentServer = (IServer)iStore.query("SELECT * FROM CI_SYSTEMOBJECTS WHERE SI_Name = 'DEVR3SP3.WebIntelligenceProcessingServer'").get(0);


        //cast the server as IWebiServerAdmin
        webiAdmin = (IWebiServerAdmin)currentServer.getServerAdmin();
        webiAdmin.setBinStreamMaxSizeUpdate(150);
        webiAdmin.commit();

        out.println("Webi Server updated <BR>");
 
        currentServer = null;
 
        currentServer = (IServer)iStore.query("SELECT * FROM CI_SYSTEMOBJECTS WHERE SI_Name = 'DEVR3SP3.WebIntelligenceProcessingServer'").get(0);

        /* The manageServer method takes 4 parameters, the parameters are as follows:
         operation - The type of operation to perform on the server. This includes starting,
                     stopping, and restarting. This value should be one of the constants
                     CE_SERVER_START, CE_SERVER_STOP, or CE_SERVER_RESTART.
         timeout - The amount of time, in seconds, before the attempt to change the state of the
                   service will fail. This value is set by default to 20 seconds.
         username - The operating system user name. The user must have the privileges to start
                   or stop the related service. This parameter can be null if the SDK is on
                   the Windows platform, which means the current user privileges will be used.
         password - The operating system password.
        */
         commandSuccess = currentServer.manageServer(IServer.CE_SERVER_RESTART,60,"","");
         if(commandSuccess == true)
              out.println("Server has been restarted!");
         else
              out.println("Server has NOT been started!");



        es.logoff();
    } catch(SDKException e) {
        out.println(e.getMessage());
    }
%>

</textarea></p>
<p>Notice the way you make these updates has completely changed in XI 3.x.  It takes a bit more code to do though.</p><p> </p>

bq. Setting the binary stream maximum value size using XI 3.x

<br /><textarea cols="75" rows="10"><%@ page import = "com.crystaldecisions.sdk.plugin.desktop.server.*,
                    com.crystaldecisions.sdk.occa.enadmin.*,
                    com.crystaldecisions.sdk.plugin.admin.cmsadmin.*,
                    com.crystaldecisions.sdk.plugin.desktop.common.*,
                    com.crystaldecisions.sdk.framework.*,
                    com.crystaldecisions.sdk.exception.*,
                    com.crystaldecisions.sdk.occa.infostore.*,
                    com.crystaldecisions.sdk.occa.security.*,
                    com.crystaldecisions.sdk.plugin.CeKind,
                    com.businessobjects.sdk.plugin.desktop.service.*,
                    java.util.*,
                    com.businessobjects.sdk.plugin.desktop.common.*,
                    com.businessobjects.sdk.plugin.desktop.service.*"
%>

<%

    //Declare logon variables
    String user = "administrator";
    String password = "Password123";
    String cms = "DEVR3SP3";
    String cmsAuthType = "secEnterprise";


    try{//Logon and Query CMS for
        IEnterpriseSession es = null;
        es = CrystalEnterprise.getSessionMgr().logon( user, password, cms, cmsAuthType);
        IInfoStore iStore = (IInfoStore) es.getService("", "InfoStore");
     
          //Query for the Webi Server
          String serverQuery = "SELECT si_name ,SI_ID, SI_HOSTED_SERVICES FROM CI_SYSTEMOBJECTS WHERE SI_KIND = 'Server' AND si_name like '%WebIntelligenceProcessing%'";
          IServer server = (IServer) iStore.query(serverQuery).get(0);

          //Query for the Webi Service
          String serviceQuery = "SELECT SI_ID FROM CI_SYSTEMOBJECTS WHERE SI_CUID = '" + CeSecurityCUID.ServerIntelligence.WEBI_REPORT_SERVICE + "'";

          IService service = (IService) iStore.query(serviceQuery).get(0);
          Integer serviceID = new Integer(service.getID());

          //Get the Services and update the required parameter
          IConfiguredServices cfgServices = server.getHostedServices();
          IConfiguredService cfgService = cfgServices.get(serviceID);
          IConfigProperties configProps = (IConfigProperties) cfgService.getConfigProps();
          IConfigProperty property = configProps.getProp("WebiParamBinStreamMaxSize");
          property.setValue(new Integer(50));
          server.save();
     
          out.println("Webi Server updated <BR>");
          
          //Restart the Server to implement the change
            server = (IServer) iStore.query(serverQuery).get(0);

            server.setExpectedRunState(ExpectedRunState.RESTART);
            server.save();

          out.println("Webi Server Restarted");

     
        es.logoff();
    } catch(SDKException e) {
        out.println(e.getMessage());
    }
%>
</textarea>
<p>Good luck with your projects!</p>
3 Comments