Java Sample – GeneratePrgrmDocReport.java for Oracle Profitability and Cost Management Cloud

Prerequisites: json.jar

Prerequisites: See Oracle Profitability and Cost Management Cloud Common Helper Functions for Java

    public void generatePrgrmDocReport() throws Exception {
        
        JSONObject json = new JSONObject();
        json.put("fileType", "PDF");
        json.put("useAlias", false);
        json.put("stringDelimter", "_");
        
        String povGroupMember = "2016_January_Actual";
        
        String urlString = serverUrl + "/epm/rest/"+ apiVersion + "/applications/" + applicationName + "/povs/" + povGroupMember.trim().replaceAll(" ", "%20") + "/programDocumentationReport";
        urlString = urlString + "?" + "queryParameter=" + json.toString();
        
        String response = executeRequest(urlString, "GET", null, "application/json");
        JSONObject jsonObj = new JSONObject(response);
        int resStatus = jsonObj.getInt("status");
        
        if(resStatus == 0) {
            System.out.println("Program Documentation Report Generated Successfully");
        }
        String details = jsonObj.getString("details");
        System.out.println(details);
            
    }