ProReport - Run report
API Url
Used for generating a new report according to the report setup. When report has finished, it will return the instance id so that it can be opened in the Report Viewer.
http://localhost:16010/ProMarkREST/rest/ProReport/reports/{id}/instances
Permissions: user
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
| export | Object | The post-processing setup (export options). Not used for 'Now online' reports. |
| format | Number | Export document format (0=None, 14=Word, 31=PDF, 901=CSV). 01431901 |
| saveTo | String | Location on disk where export file can be saved. This needs to be accessible to the reporting server! Only when 'format' > 0. |
| sendTo | String | List of e-mails to send report to. Only when 'format' > 0. |
| filters | Object[] | Contains all the filters that need to be applied. |
| fields | Object[] | Selected filter fields. |
| condition | String | Condition identifier. |
| fieldId | String | Field identifier. |
| values | String[] | List of selected values. |
| id | Number | Unique filter identifier. |
| level | Number | Filter level (0=System, 1=User profile, 2=Personal). 0-2 |
| name | String | Name of the filter. |
| options | Object[] | Selected filter options. |
| id | String | Option identifier. |
| value | String | Option value. |
| type | Number | Filter type (1=Employee, 2=Reason, 3=Account, 4=ProJect, 5=Order/Operation, 6=Workcenter, 7=Terminal). 1-7 |
| period | Object | The reporting period setup. |
| absoluteDates | Boolean | true=Absolute dates, false=Relative dates. Only used for recurrent reports. |
| balanceType | Number | Period type (1=Latest closed period, 2=Start of first open period, 3=Oldest open period, 4=Current period, 5=A given cutoff time, 6=Current and future periods) 1-5 |
| from | Datetime | Reporting period start. |
| increment | Boolean | true=Increment a fixed period each time, false=Increment an offset depending on execution date vs setup date. Only used for recurrent reports. |
| offsetAmount | Number | Nr of units to adjust with. Used together with 'offsetUnit'. Only for recurrent reports. |
| offsetUnit | Number | Increment unit. 1=Days/Today, 2=Weeks/This week, 3=Months/This month, 4=This quarter, 5=Running year. Only used for recurrent reports, where values 4 & 5 are only valid when 'absoluteDates'=false. 1-5 |
| to | Datetime | Reporting period end. |
| useTQValues | Boolean | Flag for using period values vs current values when filtering data. |
| recurrence | Object | The recurrence setup. Only for 'Recurrent' reports. |
| daily | Object | Setup for daily executions. |
| calendarDays | Boolean | Daily execution should be only in calendar days (true=Calendar days, false=Working days). |
| every | Number | Repeat every X days. |
| monthly | Object | Setup for monthly executions. |
| absoluteDay | Number | Day of month to run on. Only when 'onAbsoluteDay'=true. 1-31 |
| every | Number | Repeat every X months. |
| onAbsoluteDay | Boolean | true=Repeat on a specific day, false=Repeat on a relative day. |
| relativeDay | Number | Relative day of month to run on (1=First, 2=Second, 3=Third, 4=Forth, 5=Last). Only when 'onAbsoluteDay'=false. 1-5 |
| relativeWeekday | Number | Relative weekday of month to run on (1=Sun, 2=Mon, 3=Tue, 4=Wed, 5=Thu, 6=Fri, 7=Sat). Used together with 'relativeDay'. Only when 'onAbsoluteDay'=false. 1-7 |
| repeatUnit | Number | Repeat execution (1=Daily, 2=Weekly, 3=Monthly, 4=Yearly). |
| start | Date | First day of recurrence. |
| time | Number | Time of day when report needs to be executed, expressed in seconds from midnight. |
| weekly | Object | Setup for weekly executions. |
| every | Number | Repeat every X weeks. |
| weekDays | Boolean | Weekdays when report is to be executed, starting with Sunday. 7 |
| yearly | Object | Setup for yearly executions. |
| absoluteDay | Number | Day of month to run on. Used together with 'month'. Only when 'onAbsoluteDay'=true. 1-31 |
| month | Number | Month of year when to run the report (1=Jan, 2=Feb, 3=Mar ...). Only when 'onAbsoluteDay'=true. 1-12 |
| onAbsoluteDay | Boolean | true=Repeat on a specific month & day, false=Repeat on a relative month & day. |
| relativeDay | Number | Relative day of month to run on (1=First, 2=Second, 3=Third, 4=Forth, 5=Last). Only when 'onAbsoluteDay'=false. 1-5 |
| relativeWeekday | Number | Relative weekday of month to run on (1=Sun, 2=Mon, 3=Tue, 4=Wed, 5=Thu, 6=Fri, 7=Sat). Used together with 'relativeDay'. Only when 'onAbsoluteDay'=false. 1-7 |
| settings | Object | Basic report settings. |
| description | String | Report description. Can be anything. |
| execute | Number | Execution type (1=Now online, 2=Now via Job Scheduler, 3=Later via Job Scheduler, 4=Recurrent). 1-4 |
| executionTime | Datetime | Delayed execution time. Only for 'Later via Job Scheduler'. |
| expiry | Date | Date when report will stop being available. |
| notification | Boolean | Send notification when report has finished. Not valid for 'Now online'. |
Path parameters
| Field | Type | Description |
|---|---|---|
| id | String | Report unique identifier. |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| canRender | Boolean | Indicates whether the report can be rendered. This value is always false for Excel export and Predefined host transaction report types. For standard reports, it is false if the report exceeds the size limit. |
| fileId | String | Unique report file identifier. Use for opening the report. If empty, then report was not executed and is scheduled for a delayed execution. |
| instanceId | Number | Unique identifier of the report instance. Used for saving the report into the repository. |
| statusMessage | String | Message with execution status. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Success example:
HTTP/1.1 200 OK{"response": {"data": {"instanceId": 1234567890,"fileId": "","statusMessage": "The report was sent to the Job Scheduler."},"errorCode": 0,"errorMessage": ""}}
Error 4xx
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data (empty). |
| errorCode | Number | Error code. |
| errorMessage | String | Error description. |
Error example:
HTTP/1.1 404 Not found{"response": {"errorCode": 285,"errorMessage": "The report was not found. Maybe it was deleted by another user."}}