export_result
The report/export_result method allows you to export report results to a file.
Endpoint
svc=report/export_result¶ms={
"format": <uint>,
"pageOrientation": "<text>",
"hideGoogleLinks": <uint>,
"pageSize": "<text>",
"pageWidth": <uint>,
"coding": "<text>",
"delimiter": "<text>",
"headings": <uint>,
"compress": <uint>,
"attachMap": <uint>,
"extendBounds": <uint>,
"hideMapBasis": <uint>,
"outputFileName": "<text>",
"splitChart": "<text>",
"appendTreeAnchorRows": <uint>
}
The method is a resource-intensive request, so the limit on simultaneous resource-intensive requests during one session applies to it. If the limit is reached, the error 1003 with the
LIMIT api_concurrentreason is returned. For the list of resource-intensive requests, see Limitations.
Parameters
| Parameter | Description |
|---|---|
format |
File format bitmask (see the list below). To export multiple formats at once, add their values (for example, 2 + 4 = 6 for PDF + XLS). In that case, the output is automatically packed into a ZIP archive. |
Optional parameters:
| Parameter | Description | Default value |
|---|---|---|
compress |
Report file compression:
|
1 |
pageOrientation |
Page orientation (PDF): portrait, landscap. |
portrait |
pageSize |
Page format (PDF): a4, a3, letter, legal. |
a4 |
pageWidth |
Page width (PDF):
|
0 |
coding |
Encoding (CSV): utf8, cp1251. |
utf8 |
delimiter |
Delimiter (CSV). Possible values: semicolon (applies ;), colon (applies ,). To use a comma as a delimiter, set the value to colon or leave it empty ("delimiter":""). |
colon |
headings |
Displaying headers:
|
0 |
attachMap |
Attaching the map (PDF and HTML only):
|
0 |
extendBounds |
Extend the map to include geofences:
|
0 |
hideMapBasis |
Hiding the map layer:
|
0 |
outputFileName |
File name. | Online_report |
hideGoogleLinks |
Hide google links in coordinate cells (PDF and XLSX):
|
0 |
splitChart |
Splitting by day or week. |
<empty> |
appendTreeAnchorRows |
Append tree anchor rows with an empty row:
|
0 |
According to the logic for the extendBounds parameter, by default the map is zoomed to fit the tracks, markers, and icons. When the option is enabled, the map is also zoomed to fit the geofences. If there are no graphic elements (neither tracks, markers, icons for the default situation, nor geofences for the activated extendBounds option), the map isn’t displayed at all.
File format values (bitmask):
1: HTML;2: PDF;4: XLS;8: XLSX;16: XML;32: CSV.
Returned result
Returns a file of demanded format.
If the request fails, the response contains the text “Report has not been saved” followed by the error code, for example:
Report has not been saved{"error":5}
Error codes
| Error code | Description |
|---|---|
| 4 | Wrong input parameters: the format parameter is missing, or the file wasn’t created (for example, format doesn’t contain any of the supported values, or the report result contains no data). |
| 5 | The session has no report result (the report/exec_report request wasn’t executed or its result was cleared), or a report file reading/writing error occurred. |
| 6 | Failed to fetch the user. |