Generate Program Documentation Report
Generates a Program Documentation report for a given Profitability and Cost Management point of view.
The report is generated in the profitoutbox folder with the name
HPCMMLProgramDocumentationReport_{AppName)_{POV}.pdf
. The file can
be downloaded using File Explorer.
Required Roles
Service Administrator, Power User, User, or Viewer
REST Resource
GET
epm/rest/{api_version}/applications/{application}/povs/{POV}/programDocumentationReport
Note:
Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for EPM Cloud REST APIs. Using this REST API requires prerequisites. See Prerequisites.
Request
Supported Media Types: application/json
The following table summarizes the client request.
Table 24-21 Parameters
Name | Description | Type | Required | Default |
---|---|---|---|---|
api_version |
Version of the API you are developing with, such as v1 |
Path | Yes | None |
application |
Name of the application for which to create the report | Path | Yes | None |
pov |
The POV for which to create the report, for example, FY17_JUN_Actual_Working | Path | Yes | None |
fileType |
The file format to use for the report, PDF , XML , WORD , EXCEL , or HTML |
Query | No | PDF |
useAlias |
Boolean value to specify whether to use aliases in the report, true or false t
|
Query | No | false |
Example URL with fileType
set to PDF
and
useAlias
set to true
:
https://<BASE-URL>/epm/rest/v1/applications/BksML30/povs/2016_January_Actual/programDocumentationReport?queryParameter={"fileType":"PDF","useAlias":"true"}
Response
Supported Media Types: application/json
Table 24-22 Parameters
Name | Description |
---|---|
details |
Program Documentation report name, such as HPCMMLProgramDocumentationReport_BksML30_2016_January_Actual.pdf , and report status
|
status |
See Migration Status Codes |
statusMessage |
Message about the status, such as Success |
type |
Profitability |
data |
Parameters as key value pairs |
links |
Detailed information about the link |
href |
Links to API call |
action |
The HTTP call type |
rel |
Relationship type |
data |
Parameters as key value pairs passed in the request |
Example of Response Body
The following shows an example of the response body in JSON format.
{
"type":"Profitability",
"status":0,
"statusMessage":"Success",
"details":"Program Documentation report HPCMMLProgramDocumentationReport_BksML30_2016_January_Actual.pdf generated successfully in the Outbox folder."
}
Java Sample – GeneratePrgrmDocReport.java for Profitability and Cost Management
Prerequisites: json.jar
Common Functions: See Profitability and Cost Management 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);
}
cURL Sample – GeneratePrgDocReport.sh for Profitability and Cost Management
Common Functions: See Profitability and Cost Management Common Helper Functions for cURL.
funcGeneratePrgDocReport() {
url=$SERVER_URL/epm/rest/$API_VERSION/applications/$APP_NAME/povs/$POV_GROUP_MEMBER1/programDocumentationReport
echo $url
curl -G "$url" --data-urlencode 'queryParameter={"fileType":"PDF","stringDelimter":"_","useAlias":"false"}' -u "$USERNAME:$PASSWORD" -o "response.txt" -D "respHeader.txt"
output=`cat response.txt`
status=`echo $output | jq '.status'`
echo $status
if [ $status == 0 ]; then
echo "Program Documentation Report generated successfully"
message=`echo $output | jq '.details'`
echo $message
else
error=`echo $output | jq '.details'`
echo "Error occurred. " $error
fi
funcRemoveTempFiles "respHeader.txt" "response.txt"
}
Groovy Sample – GeneratePrgrmDocReport.groovy for Profitability and Cost Management
Prerequisites: json.jar
Common Functions: See Appendix C: Common Helper Functions for Groovy.
def generateProgramDocReportJob() {
JSONObject json = new JSONObject();
json.put("fileName", "2016JanActual.pdf");
json.put("fileType", "PDF");
json.put("useAlias", false);
json.put("stringDelimter", "_");
String povGroupMember = "2016_January_Actual";
String urlString = serverUrl + "/epm/rest/"+ apiVersion + "/applications/"
+ appName + "/povs/" + povGroupMember.trim().replaceAll(" ", "%20") + "/
jobs/programDocReportJob";
def url;
try {
url = new URL(urlString)
} catch (MalformedURLException e) {
println "Malformed URL. Please pass valid URL"
System.exit(0);
}
executeJob(url, "POST", json.toString());
}