Create and run an action to export a report as a PDF file

post/reports/{reportId}/exportPdf
Internal-Use Only

Start a job from the request information that creates and exports the report as a PDF file. Apply the rendering option values in the request object to the creation of the PDF output. The request's options override (1) any defaults of the underlying rendering services, and (2) any defaults that were saved with the report by the SAS Visual Analytics application.

Request Samples

1

Response Samples

1{
2 "id": "12345678-abcd-ef12-3456-12345678abab",
3 "state": "running",
4 "inputReport": "/reports/reports/12345678-abcd-ef12-3456-12345678abcd",
5 "reportObjects": [
6 "Bar Graph 1",
7 "Table of Frequencies"
8 ],
9 "resultFolder": "/folders/folders/01234567-0123-0123-0123-0123456789ab",
10 "resultFileName": "Status Report Final",
11 "nameConflict": "replace",
12 "resultMediaType": "application/pdf",
13 "creationTimeStamp": "2021-06-21T21:10:31.123Z",
14 "endTimeStamp": "2021-06-21T21:10:41.123Z",
15 "links": [
16 {
17 "rel": "self",
18 "method": "GET",
19 "type": "application/vnd.sas.visual.analytics.report.export.pdf.job",
20 "uri": "/visualAnalytics/jobs/12345678-1234-1234-1234-123456789abc",
21 "href": "/visualAnalytics/jobs/12345678-1234-1234-1234-123456789abc"
22 },
23 {
24 "rel": "result",
25 "method": "GET",
26 "type": "application/*",
27 "uri": "/files/files/12345678-1234-1234-1234-123456789abc/content",
28 "href": "/files/files/12345678-1234-1234-1234-123456789abc/content"
29 },
30 {
31 "rel": "delete",
32 "method": "DELETE",
33 "uri": "/visualAnalytics/jobs/12345678-1234-1234-1234-123456789abc",
34 "href": "/visualAnalytics/jobs/12345678-1234-1234-1234-123456789abc"
35 },
36 {
37 "rel": "deleteContent",
38 "method": "DELETE",
39 "uri": "/files/files/12345678-1234-1234-1234-123456789abc",
40 "href": "/files/files/12345678-1234-1234-1234-123456789abc"
41 }
42 ],
43 "version": 1
44}

Path Parameters

NameTypeRequiredDescription
reportId
string
true

Identifier of an existing report resource. Report identifiers are generated by the Reports API when reports are created.

Examples:
"12345678-abcd-ef12-3456-123456789abc"

Header Parameters

NameTypeRequiredDescription
Accept-Language
string
false

The user's language, which is used in both rendering and caching. For technical details, see "/tools.ietf.org/html/rfc7231#section-5.3.5" It affects the language of reports if they have been translated. This setting overrides any other user preference that has been set, such as the "offline process locale" preference in Visual Analytics. If this header is not set and there is no user preference, the language is the default language of the service.

Accept-Locale
string
false

A "format locale" that is distinct from the user's language (Accept-Language). Its syntax is similar to Accept-Language. It is honored in running of queries and formatting of values. This setting overrides any other user preference that has been set, such as the "regional locale for formats" preference in Visual Analytics. If this header is not set and there is no user preference, the format locale is the default locale of the service.

Request Body

Information about the PDF that is requested.

NameTypeRequiredDescription
resultFolder
string
false

The URI of the folder in which the output file should be created. Specifying a folder URI allows the result to be visible in user interfaces that show files, and it puts the lifetime of the result file in the control of the client. If the result folder is not specified, the result file is transient; the system can clean up results on its own schedule, and it retains control of the lifetime of the file. The client can specify placeholder "/folders/folders/@myFolder" to save it in the user's personal folder. If the folder is specified and does not exist, it is an error.

resultFilename
string
false

The user-visible file name of the output when it is saved in a folder on the server. If the resultFolder is provided and no resultFilename is specified on the request, the service gives the file a default name. On a running or completed job, the file name is either the requested name, optionally modified by the system to avoid name conflicts, or if the request specified no file name, it is the name generated by the system.

Example:
"Sample Output File Name.svg"
nameConflict
string
false

The strategy for handling name collision when saving the result file. The value replace means overwrite any pre-existing file. The value rename specifies that the service should modify the requested name to be unique, such as by appending a number to the name. The default value is rename.

Allowed values:
replacerename
reportObjects
array [string]
false

A list of report object names for the objects to include in the exported file. If left empty, the result is dependent on the type of the export. For some types of export, omitting report objects means that the entire report will be processed. Report objects include visual elements like graphs and tables, visual containers that the author has created in the layout, and complete pages. Labels are not forced to be unique because they can be edited by the user. The design makes it more convenient for the report author or viewer and does not to expose the internal names of objects in the model. However, if the client knows the internal identifier of a report object, it can be used instead of the label.

wait
integer
false

Number of seconds to wait before returning from the initial POST to start the job. The default value is effectively zero, meaning to return the running job to the client as soon as it is created. Specifying a positive value instructs the server to wait on the running job for the specified number of seconds because the client expects the job to finish quickly. This allows the client to avoid having to poll for completion. It should be used cautiously because job durations are unpredictable.

Example:
30
timeout
integer
false

After creation of the job, the maximum number of seconds it will be allowed to run before timing out. The default maximum is a system configuration value. This option allows the maximum to be modified for this request, but its value cannot exceed a system-configured maximum limit. There is no guarantee that all background processes can be terminated when time-out is exceeded, but an attempt will be made where it is possible.

Example:
60
options
ExportPdfOptions
true

Options for executing the action. May describe output characteristics or control parameters. Not all properties are applicable to every action.

version
integer
true

Version of this request object, which is currently version 1.

Responses

StatusMeaningDescription
201CreatedThe job ran and completed within the wait time allotted. The response body contains links to the job object, which contains information about result output.HeadersSchema
202AcceptedThe job has been created. The response body contains links to requery for results and status of the job. This is expected to be the most usual case.HeadersSchema
400Bad RequestThere was an error in the request.HeadersSchema