The ReportPlayer widget runs infographic report templates for a provided analysis area. It works with the standard provided Esri infographic report templates or custom created infographic report templates. Infographics can be viewed in full page mode or as slides. Once the infographic report is generated it can be exported to a PDF, image, or dynamic HTML.
The ReportPlayer requires an authenticated user in order to access ArcGIS items and make requests to Geoenrichment. It does not handle sign-in operations. The application has to authenticate the user before running the ReportPlayer. This code snippet shows how you can setup authentication prior to using the ReportPlayer:
// Required classes "esri/arcgis/OAuthInfo", "esri/IdentityManager" var info = new OAuthInfo({ appId: "[Application ID]", portalUrl: "[Portal URL]", popup: false }); IdentityManager.registerOAuthInfos([info]); IdentityManager.checkSignInStatus(info.portalUrl).then(function () { // Start Report Player }).otherwise(function () { IdentityManager.getCredential(info.portalUrl, { oAuthPopupConfirmation: false}).then(function () { // Start Report Player }); }); });For more information on ArcGIS authentication see OAuthInfo.
Name | Summary |
---|---|
new esri.dijit.geoenrichment.ReportPlayer.ReportPlayer(params?, srcNode?) | Creates a new ReportPlayer dijit using the given DOM node. |
Name | Type | Summary |
---|---|---|
allowKeyboardNavigation | Boolean | Indicates whether left and right arrows key can be used to paginate when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES . |
config | Object | Configuration to specify the location of the JavaScript API to use when exporting an Infographic to Dynamic HTML. |
dataProvider | DataProviderGE | Data Provider for the ReportPlayer which allows you to specify which export options are available when running the report. |
defaultZoomBehavior | String | Specifies how the ReportPlayer should zoom by default. |
enableDataDrilling | Boolean | Indicates whether interactive experience for panels should be enabled. |
resizeMode | String | Specifies the resize mode of the ReportPlayer. |
scaleSlidesToFitWindow | Boolean | If true , indicates that panels should scale to fit the window. |
showAreaTitle | Boolean | Indicates whether the analysis area title will be shown in the toolbar. |
showToolbarInPopup | Boolean | Indicates whether the toolbar will be shown in a compact popup view. |
theme | String | Specifies the theme of the ReportPlayer. |
viewMode | String | Specifies the display of the report in full page view, slide view, or stacked panel view. |
Name | Return type | Summary |
---|---|---|
playReport(dataProviderParams, playParams?) | Deferred | Generates the report for the supplied parameters. |
resize(width?, height?) | Promise | Sets the width and height of the ReportPlayer when resizeMode is set to PlayerResizeModes.MANUAL . |
setMaxHeight(number) | Number | Sets the maximum height for the Report Player. |
setMaxWidth(number) | Number | Sets the maximum width for the Report Player. |
< > params |
Optional | Various parameters that can be used to configure the ReportPlayer. All properties can be passed into the constructor as options. |
< > srcNode |
Optional | Reference or id of the HTML element where the widget should be rendered. |
params
properties: < > allowKeyboardNavigation |
Optional | Indicates whether left and right arrows key can be used to paginate when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES . It defaults to true . |
< > config |
Optional | As of version 3.26 Configuration to specify the location of the JavaScript API to use when exporting an Infographic to Dynamic HTML. This is required if enabling Export to Dynamic HTML , otherwise it is not required. Please see the config property for its available Object properties. |
< > dataProvider |
Optional | Specifies which export options are available for the report. |
< > defaultZoomBehavior |
Optional | Specifies how the ReportPlayer should zoom by default. It defaults to FIT_PAGE . |
< > enableDataDrilling |
Optional | Indicates whether interactive experience for panels should be enabled. It defaults to true . |
< > resizeMode |
Optional | Specifies the resize mode of the ReportPlayer. It defaults to AUTO. |
< > scaleSlidesToFitWindow |
Optional | If true , indicates that panels should scale to fit the window. Applicable when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES . It defaults to true . |
< > showAreaTitle |
Optional | Indicates whether the analysis area title will be shown in the toolbar. It defaults to true . |
< > showToolbarInPopup |
Optional | Indicates whether the toolbar will be shown in a compact popup view. It defaults to false . |
< > theme |
Optional | Specifies the theme of the ReportPlayer. It defaults to DARK. |
< > viewMode |
Optional | Specifies the display of the report in full page view, slide view, or stacked panel view. Defaults to PlayerViewModes.FULL_PAGES for full page view. In version 3.24, you would have used the now deprecated property, isSlidesView . Please use the viewMode property in place of this. |
Boolean
> allowKeyboardNavigationviewMode
is set to PlayerViewModes.PANELS_IN_SLIDES
. (Added at v3.25)true
Object
> configExport to Dynamic HTML
, otherwise it is not required. See the object specifications table below for the structure of the config
object. (Added at v3.26)config
>< > esriCssUrl |
Optional | An optional string URL referencing the esri.css stylesheet in the Esri JavaScript API, e.g. e.g. "https://js.arcgis.com/3.26/esri/css/esri.css". |
< > esriDijitCssUrl |
Optional | An optional string URL referencing the claro.css stylesheet in the Esri JavaScript API, e.g. "https://js.arcgis.com/3.26/dijit/themes/claro/claro.css". |
< > playerSourceRootUrl |
Optional | An optional string URL referencing the Esri JavaScript API, e.g. "https://js.arcgis.com/3.26/". |
DataProviderGE
> dataProviderString
> defaultZoomBehaviorFIT_PAGE
Boolean
> enableDataDrillingtrue
String
> resizeModeAUTO
Boolean
> scaleSlidesToFitWindowtrue
, indicates that panels should scale to fit the window. Applicable when viewMode
is set to PlayerViewModes.PANELS_IN_SLIDES
. (Added at v3.25)true
Boolean
> showAreaTitletrue
Boolean
> showToolbarInPopupfalse
String
> themeDARK
String
> viewModeFULL_PAGES
Deferred
< > dataProviderParams |
Required | See the object specifications table below for the structure of the dataProviderParams object. |
< > playParams |
Optional | See the object specifications table below for the structure of the playParams object. |
analysisJson
>< > address |
Optional | Address of location, can be displayed in the generated infographic. |
< > description |
Optional | A description for the location, can be displayed in the generated infographic. |
< > feature |
Required | Feature of the generated infographic. Geometry is required. Attributes, symbol, and infoTemplate are optional. See sample snippets below:
var analysisJson = [{ "name": "Area name", "shortName": "Area name (short)", "description": "Area description", "address": "Area address", "latitude": "Area Lat.", "longitude": "Area Long.", "feature": { "geometry": { "rings": [ [ [-8238372.646123883, 4971599.356069453], [-8236117.753789412, 4970600.8973874515], [-8235730.791333708, 4968556.206880769], [-8240211.912117044, 4969607.216019718], [-8238372.646123883, 4971599.356069453] ] ], "spatialReference": { "wkid": 102100 } }, "attributes": { "ATTR_1": 1000.12345, "ATTR_2": 2000.12345, "ATTR_3": 3000.12345 }, "symbol": { "color": [ 64, 128, 194, 50 ], "outline": { "color": [ 64, 128, 194, 255 ], "width": 1.5, "type": "esriSLS", "style": "esriSLSSolid" }, "type": "esriSFS", "style": "esriSFSSolid" }, "infoTemplate": { "fieldInfos": [ { "fieldName": "ATTR_1", "label": "Attribute 1", "format": { places: 1 }, "visible": true }, { "fieldName": "ATTR_2", "label": "Attribute 2", "format": { places: 2 }, "visible": true }, { "fieldName": "ATTR_3", "label": "Attribute 3", "format": { places: 3 }, "visible": true } ] } } }];The following shows how to specify the location information. This will appear in the UI and in the infographic. var analysisArea = { // Optional. Specify if an area is related to a location point // (e.g. a ring around a location). // Will populate SITE_NAME & STORE_NAME attributes in the report. "locationName": "New York site", "name": "New York site (1 mile)", // Full area name. If locationName is missing, // will populate SITE_NAME & STORE_NAME attributes // in the report. "shortName": "1 mile", // Will be shown in drop downs for quick // area selection. "description": "Ring of 1 mile", // Will populate AREA_DESC2 in the report. "address": "Apple st. 32, CA", "latitude": "Area Lat.", "longitude": "Area Long." }The analysis area's geometry can be set three various ways: // 1 - Using a Graphic // Can also use Graphic's Json. // Attributes can optionally contain STORE_LAT // and STORE_LONG to specify // the point of reference used for locator reports. analysisArea.feature = new Graphic(geometry, symbol, attributes) // 2 - Geographies. This is used to enrich by geography // ids instead of the feature geometry. STORE_LAT and // STORE_LONG are optional and are used as a point of // reference for locator reports. analysisArea.geographies = [{ id: "01", // Required levelId: "US.States", // Required attributes: { STORE_LAT: Number, STORE_LONG: Number, ... other attributes }, // Optional symbol: Symbol or Json // Optional, use this to apply custom symbolization. }] // 3 - Buffer - Will be enriched with a geometry to build // a buffer ring. analysisArea.buffer = { // e.g. {x: -8259520.139751502, y: 4974476.975557825, // spatialReference: {wkid: 102100} point: Geometry or Json, units: String, // e.g. "esriMiles" radius: Number, // e.g. 1 // Optional, to pass attributes to the enriched polygon attributes: Object, // Optional, to apply custom symbolization to the enriched polygon symbol: Symbol or Json } |
< > geographies |
Optional | An array of geographies to be used instead of a feature geometry.
"geographies": { {"id":"32", "levelId":"US.States"}, {"id":"06", "levelId":"US.States"} } |
< > latitude |
Optional | Latitude of location, can be displayed in the generated infographic. |
< > longitude |
Optional | Longitude of location, can be displayed in the generated infographic. |
< > name |
Optional | The name of the location, this is often displayed in the generated infographic. |
< > shortName |
Optional | A short name for the location, can be displayed in the generated infographic. |
dataProviderParams
>< > analysisAreas |
Required | An array of analysisJson objects which detail the location that the infographic will run on. See the additional information regarding the analysisJson object. |
< > countryID |
Required | Two-digit country code. For example: "US". |
< > geoenrichmentUrl |
Optional | The URL of the Geoenrichment service. If not specified, it will be discovered via the portal helper services. |
< > portalUrl |
Required | URL of the ArcGIS Portal instance. For example, "https://www.arcgis.com". |
< > reportID |
Required | The itemID of the Report Template to run. This is the ID of the ReportTemplate item in your content. Can also use one of the following strings to run an Eri infographic:
|
playParams
>< > disableAnimation |
Optional | Indicates whether to disable the animation in the generated report. Defaults to false. |
< > waitUntilAllContentIsReady |
Optional | Set this value to true if required to know when the report has finished loading all of its content. The default value is false. |
resizeMode
is set to PlayerResizeModes.MANUAL
. If in any other resizeMode
, call this without setting any parameters to resize to the specified resizeMode
. (Added at v3.25)Promise
resizeMode
is set to PlayerResizeModes.MANUAL
. (Added at v3.25)Number
< > number |
Required | The height in pixels. |
resizeMode
is set to PlayerResizeModes.MANUAL
. (Added at v3.25)Number
< > number |
Required | The width in pixels. |