### Getting started with the Page Report Studio API

How to get an instance of Page Report Studio API

Note that before you can use the following methods to get a Page Report Studio API instance, firstly you need to import some relevant packages. For instance, jet.web.dhtml.* must be included here.

- For local use

  Both of the following methods can be used to get an instance of the Page Report Studio API locally. The results of these two methods are exactly the same.

  - Method 1:

    `DHTMLClientService service = DHTMLServiceFactory.getDHTMLClientService(request);`

  - Method 2:

        HttpRptServer server;
        if (System.getProperty(APIConst.REMOTE_DISPATCHER) == null) {
            server = HttpUtil.getHttpRptServer();
        } else {
            server = RemoteDispatcherFactory.getInstance().getDispatchedServer(request);
        }
        DHTMLClientService service = (DHTMLClientService)server.getDHTMLClientService();

- For RMI use

  This method can be used to get an instance of Page Report Studio API from a remote server (RMI).

      HttpRptServer server;
      if (System.getProperty(APIConst.REMOTE_DISPATCHER) == null) {
          server = HttpUtil.getHttpRptServer();
      } else {
          server = RemoteDispatcherFactory.getInstance().getDispatchedServer(request);
      }
      DHTMLClientService service = server.getDHTMLClientService();