ReportTask

ReportTask ⏏

Class to trigger the generation of a report.

Kind: Exported class

reportTask.createReport(parameters)

Creates a report

Kind: instance method of ReportTask

Param Type Description
parameters Object Report parameters

Example

let parameters = {
       // ID of the data store.
       storeId: "medianAgeStore"
       // URL of the corresponding map or feature service.
       dsUrl: "https://server.arcgisonline.com/arcgis/rest/services/Demographics/USA_Median_Age/MapServer/4",
       // IDs of the features that are included in the report
       ids: [1, 2, 3, 4, 5],
       // ID of report (optional). If not provided the report of the mapping or the default report is used.
       reportId: "medianAgeReport",
       // Filename of the report. If not provides the filename of the mapping or the default filename is
       // used.
       fileName: "Median_Age_Report_USA.pdf",
       // Download report directly (optional). If not defined the mapping property or the default property is
       // used.
       directDownload: true
   };
   reportTask.createReport(parameters);

reportTask.addMapping(mapping)

Adds a report mapping

Kind: instance method of ReportTask

Param Type Description
mapping Object Report mapping

Example

let mapping = {
      // ID of the datasource (data store)
      "storeId": "country_store",
      // ID of the report
      "reportId": "country_report",
      // optional (overwrites property `defaultFileName` for this report)
      "fileName": "Country_Report.pdf",
      // optional (overwrites global property for this report)
      "directDownload": true
   };
   reportTask.addMapping(mapping);

reportTask.removeMapping(mapping) ⇒

Removes a report mapping

Kind: instance method of ReportTask
Returns: True if the mapping was removed or false if it could not be found.

Param Type Description
mapping Object Report mapping