FRAMES | NO FRAMES
SummaryReports Method

Create Summary Reports for custom trade/service areas, get mappable representations of these areas and named standard geographic areas (administrative boundaries), and summarize their underlying demographics and market characteristics with a library of reports.

TaskResultOutput SummaryReports ( 
    SummaryReportsParameters  Parameters,
    TaskOutputType[]          OutputType
);

Parameter Description
Parameters Configuration options for analysis including report type options. Type SummaryReportsParameters.
OutputType Array of task output options. Options for this method include creating a report (GetReport) and obtaining the polygon geometry (GetFeatureClass). Type TaskOutputType[].

Returns

Variable of type TaskResultOutput.

The Summary Reports service can be used to create one or more reports for a given set of Boundaries. With several report template options, Summary Reports leverages Business Analyst Online's data layers to comprehensively describe, analyze, and summarize information associated with the input boundary areas. Summary Reports may also be leveraged to create mappable Feature Class representations of Get Standard Geography Levels and boundary areas.

S.XML (Simplified XML) Report Output:

Usage Tips


Much of the value of Business Analyst Online lies in its extremely valuable and quite extensive underlying data. With the Summary Reports service, this data can be leveraged to create many types of high-quality reports for a variety of use cases describing the input areas.

Some applications of Summary Reports include the following:

Examples

Example 1: Create ring-based trade areas for two store point locations and generate summary reports describing the resulting areas.

Notes: Example 1 demonstrates the use of the BAOReportHelper class. For information about code that consumes the BAOReport proxy class, (generated from the WSDL ) without leveraging the BAOReportHelper class, please refer to the BAOReport vs BAOReportHelper comparison chart and see the additional Examples below.
Download complete source code as Visual Studio solution to immediately execute samples. (See SummaryReportsExamples.summaryReportsExample1 in source.)

Output Report Created with Example

Click to download actual output file

Click to download actual output file

Click to download actual output file

Example (1) Code
C#
// Authentication: Uses BAOReportHelper class for token management.

// Instantiate BAOReportHelper class
string tokenServiceUrl = "https://baoapi.esri.com/bawebservices/rest/authentication";

// Business Analyst Online API Sample credentials.
// NOTE: These credentials are associated with an 
// account which constrains analysis to the
// two ZIP codes in Redlands, CA.
string username = "BAOAPISAMPLE"; // Substitute user name here
string password = "baoapisample"; // Substitute password here

ITokenProvider tokenProvider = new HTTPTokenProvider(tokenServiceUrl, username, password);
BAOReportHelper baoReportHelper = new BAOReportHelper(tokenProvider);

// Create store points
PointRecord[] points = new PointRecord[2];

points[0] = new PointRecord();
points[0].Name = "redlands1";
points[0].Description = "Redlands Store 1";
points[0].StoreID = "1";
points[0].Latitude = 34.030637;
points[0].Longitude = -117.190671;

points[1] = new PointRecord();
points[1].Name = "redlands2";
points[1].Description = "Redlands Store 2";
points[1].StoreID = "2";
points[1].Latitude = 34.081008;
points[1].Longitude = -117.148639;


// Create a store feature layer based on an array of point records
PointLayer storeLayer = new PointLayer();
storeLayer.Points = points;

// Specify the spatial reference for WGS_1984 coordinate system
storeLayer.SpatialReference = new GeographicCoordinateSystem();
storeLayer.SpatialReference.WKID = 4326;
storeLayer.SpatialReference.WKIDSpecified = true;

// Specify parameters of SimpleRings task
SimpleRingsParameters parameters = new SimpleRingsParameters();
parameters.ReportOptions = null;
parameters.DistanceUnits = esriUnits.esriMiles;
parameters.Donut = false;
parameters.Radii = new double[] { 1, 3, 5 };
parameters.StoreIDField = "STORE_ID";
parameters.Stores = storeLayer;

RenderingParameters imageOptions = null;
TaskOutputType[] outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass };

// Execute the task
TaskResultOutput result = baoReportHelper.SimpleRings(parameters, imageOptions, outputOptions);

// Specify report options
ReportOptions ro1 = new ReportOptions();
ro1.ReportFormat = "PDF";
ro1.TemplateName = "dandi";

ReportOptions ro2 = new ReportOptions();
ro2.ReportFormat = "S.XML";
ro2.TemplateName = "dandi";

ReportOptions ro3 = new ReportOptions();
ro3.ReportFormat = "PDF";
ro3.ReportHeader = new KeyValue[1];
ro3.ReportHeader[0] = new KeyValue();
ro3.ReportHeader[0].Key = "subtitle";
ro3.ReportHeader[0].Value = "My Static Subtitle";
ro3.TemplateName = "market_profile";

// Specify parameters of SummaryReports task
SummaryReportsParameters reportsParameters = new SummaryReportsParameters();
reportsParameters.ReportOptions = new ReportOptions[] { ro1, ro2, ro3 };
reportsParameters.AreaIDField = "AREA_ID";
reportsParameters.RingIDField = "RING";
reportsParameters.StoreIDField = "STORE_ID";

DataLayer taLayer = new DataLayer();
taLayer.RecordSet = result.RecordSet; // Assign resulting simple rings
reportsParameters.Boundaries = taLayer;

// Execute the task
result = baoReportHelper.SummaryReports(reportsParameters);

// The result.Reports property contains array of generated reports.

Example (1) Code
VB.NET
' Authentication: Uses BAOReportHelper class for token management.

' Instantiate BAOReportHelper class
Dim tokenServiceUrl As String = "https://baoapi.esri.com/bawebservices/rest/authentication"

' Business Analyst Online API Sample credentials.
' NOTE: These credentials are associated with an 
' account which constrains analysis to the
' two ZIP codes in Redlands, CA.
Dim username As String = "BAOAPISAMPLE"
' Substitute user name here
Dim password As String = "baoapisample"
' Substitute password here
Dim tokenProvider As ITokenProvider = New HTTPTokenProvider(tokenServiceUrl, username, password)
Dim baoReportHelper As New BAOReportHelper(tokenProvider)

' Create store points
Dim points As PointRecord() = New PointRecord(1) {}

points(0) = New PointRecord()
points(0).Name = "redlands1"
points(0).Description = "Redlands Store 1"
points(0).StoreID = "1"
points(0).Latitude = 34.030637
points(0).Longitude = -117.190671

points(1) = New PointRecord()
points(1).Name = "redlands2"
points(1).Description = "Redlands Store 2"
points(1).StoreID = "2"
points(1).Latitude = 34.081008
points(1).Longitude = -117.148639


' Create a store feature layer based on an array of point records
Dim storeLayer As New PointLayer()
storeLayer.Points = points

' Specify the spatial reference for WGS_1984 coordinate system
storeLayer.SpatialReference = New GeographicCoordinateSystem()
storeLayer.SpatialReference.WKID = 4326
storeLayer.SpatialReference.WKIDSpecified = True

' Specify parameters of SimpleRings task
Dim parameters As New SimpleRingsParameters()
parameters.ReportOptions = Nothing
parameters.DistanceUnits = esriUnits.esriMiles
parameters.Donut = False
parameters.Radii = New Double() {1, 3, 5}
parameters.StoreIDField = "STORE_ID"
parameters.Stores = storeLayer

Dim imageOptions As RenderingParameters = Nothing
Dim outputOptions As TaskOutputType() = New TaskOutputType() {TaskOutputType.GetFeatureClass}

' Execute the task
Dim result As TaskResultOutput = baoReportHelper.SimpleRings(parameters, imageOptions, outputOptions)

' Specify report options
Dim ro1 As New ReportOptions()
ro1.ReportFormat = "PDF"
ro1.TemplateName = "dandi"

Dim ro2 As New ReportOptions()
ro2.ReportFormat = "S.XML"
ro2.TemplateName = "dandi"

Dim ro3 As New ReportOptions()
ro3.ReportFormat = "PDF"
ro3.ReportHeader = New KeyValue(0) {}
ro3.ReportHeader(0) = New KeyValue()
ro3.ReportHeader(0).Key = "subtitle"
ro3.ReportHeader(0).Value = "My Static Subtitle"
ro3.TemplateName = "market_profile"

' Specify parameters of SummaryReports task
Dim reportsParameters As New SummaryReportsParameters()
reportsParameters.ReportOptions = New ReportOptions() {ro1, ro2, ro3}
reportsParameters.AreaIDField = "AREA_ID"
reportsParameters.RingIDField = "RING"
reportsParameters.StoreIDField = "STORE_ID"

Dim taLayer As New DataLayer()
taLayer.RecordSet = result.RecordSet
' Assign resulting simple rings
reportsParameters.Boundaries = taLayer

' Execute the task
result = baoReportHelper.SummaryReports(reportsParameters)

' The result.Reports property contains array of generated reports.

 

Example 2: Create a report with static custom report headers on two standard geographic areas (two ZIP codes specified with a StdLayer in the Boundaries parameter) and return the serialized feature class geometry of these area for client side rendering or analysis.

Notes: Example 2 demonstrates code which consumes the BAOReport proxy class (generated from the WSDL ) without leveraging the BAOReportHelper class. Please view Example 1 above for additional information about the BAOReportHelper class.

Download complete source code as Visual Studio solution to immediately execute samples. (See SummaryReportsExamples.summaryReportsExample2 in source.)

Output Report Created with Example

Click to download actual output file

Example (2) Code
C#
// Authentication: Uses Authentication proxy class to generate token.

// Business Analyst Online API Sample credentials.
// NOTE: These credentials are associated with an 
// account which constrains analysis to the
// two ZIP codes in Redlands, CA.
string username = "BAOAPISAMPLE"; // Substitute user name here
string password = "baoapisample"; // Substitute password here

Authentication auth = new Authentication();
string token = auth.getToken(username, password);

// Specify standard geography features with StdLayers
StdLayer stdLayer1 = new StdLayer();
stdLayer1.ID = "US.ZIP5";
stdLayer1.GeographyIDs = new string[] { "92373", "92374" };

// Specify custom report header options
KeyValue address_header = new KeyValue();
address_header.Key = "address";
address_header.Value = "[address field]";
KeyValue locationname_header = new KeyValue();
locationname_header.Key = "locationname";
locationname_header.Value = "[locationname field]";
KeyValue subtitle_header = new KeyValue();
subtitle_header.Key = "subtitle";
subtitle_header.Value = "[subtitle field]";

// Create a report and populate with custom report header options
ReportOptions ro1 = new ReportOptions();
ro1.TemplateName = "dandi";
ro1.ReportFormat = "PDF";
ro1.ReportHeader = new KeyValue[] { address_header, locationname_header, subtitle_header };

// Specify analysis options
TaskOutputType[] outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass,
    TaskOutputType.GetReport};

// Specify parameters of SummaryReports task
SummaryReportsParameters reportsParameters = new SummaryReportsParameters();
reportsParameters.ReportOptions = new ReportOptions[] { ro1 };

DataLayer dataLayer = new DataLayer();
dataLayer.StdLayer = stdLayer1;
reportsParameters.Boundaries = dataLayer;
reportsParameters.token = token;

// Instantiate the BAOReport proxy object to submit the
// request
BAOReport baoReportProxy = new BAOReport();

// Submit the task
TaskResultOutput result = baoReportProxy.SummaryReports(reportsParameters, outputOptions);

// The result.Reports property contains array of generated reports and the result.RecordSet
// property contains the geometry.

Example (2) Code
VB.NET
' Authentication: Uses Authentication proxy class to generate token.

' Business Analyst Online API Sample credentials.
' NOTE: These credentials are associated with an 
' account which constrains analysis to the
' two ZIP codes in Redlands, CA.
Dim username As String = "BAOAPISAMPLE"
' Substitute user name here
Dim password As String = "baoapisample"
' Substitute password here
Dim auth As New Authentication()
Dim token As String = auth.getToken(username, password)

' Specify standard geography features with StdLayers
Dim stdLayer1 As New StdLayer()
stdLayer1.ID = "US.ZIP5"
stdLayer1.GeographyIDs = New String() {"92373", "92374"}

' Specify custom report header options
Dim address_header As New KeyValue()
address_header.Key = "address"
address_header.Value = "[address field]"
Dim locationname_header As New KeyValue()
locationname_header.Key = "locationname"
locationname_header.Value = "[locationname field]"
Dim subtitle_header As New KeyValue()
subtitle_header.Key = "subtitle"
subtitle_header.Value = "[subtitle field]"

' Create a report and populate with custom report header options
Dim ro1 As New ReportOptions()
ro1.TemplateName = "dandi"
ro1.ReportFormat = "PDF"
ro1.ReportHeader = New KeyValue() {address_header, locationname_header, subtitle_header}

' Specify analysis options
Dim outputOptions As TaskOutputType() = New TaskOutputType() {TaskOutputType.GetFeatureClass, TaskOutputType.GetReport}

' Specify parameters of SummaryReports task
Dim reportsParameters As New SummaryReportsParameters()
reportsParameters.ReportOptions = New ReportOptions() {ro1}

Dim dataLayer As New DataLayer()
dataLayer.StdLayer = stdLayer1
reportsParameters.Boundaries = dataLayer
reportsParameters.token = token

' Instantiate the BAOReport proxy object to submit the
' request
Dim baoReportProxy As New BAOReport()

' Submit the task
Dim result As TaskResultOutput = baoReportProxy.SummaryReports(reportsParameters, outputOptions)

' The result.Reports property contains array of generated reports and the result.RecordSet
' property contains the geometry.

 

Example 3: Create two reports on areas defined by three custom polygons described by DataLayer as FeatureSet (Feature RecordSet). Use dynamic report headers to populate the report headers using attributes from each input feature. Additionally, request a image file of the input polygon features.

Notes: Example 3 demonstrates code which consumes the BAOReport proxy class (generated from the WSDL ) without leveraging the BAOReportHelper class. Please view Example 1 above for additional information about the BAOReportHelper class.

This sample is functionally equivalent to the REST Summary Reports Example 2.

Download complete source code as Visual Studio solution to immediately execute samples. (See SummaryReportsExamples.summaryReportsExample3 in source.)

Output Report Created with Example

Click to download actual output file

Click to download actual output file

Example (3) Code
C#
// Authentication: Uses Authentication proxy class to generate token.

// Business Analyst Online API Sample credentials.
// NOTE: These credentials are associated with an 
// account which constrains analysis to the
// two ZIP codes in Redlands, CA.
string username = "BAOAPISAMPLE"; // Substitute user name here
string password = "baoapisample"; // Substitute password here

Authentication auth = new Authentication();
string token = auth.getToken(username, password);

SpatialReference gcs = new GeographicCoordinateSystem();
gcs.WKID = 4326;
gcs.WKIDSpecified = true;

// Define a geometry definition of the FeatureSet (Feature RecordSet)
GeometryDef geomDef = new GeometryDef();
geomDef.GeometryType = esriGeometryType.esriGeometryPolygon;
geomDef.SpatialReference = gcs;

// Define the attribute fields of the FeatureSet
Field oidField = new Field();
oidField.Name = "OID";
oidField.AliasName = "Object ID";
oidField.Type = esriFieldType.esriFieldTypeOID;
Field shapeField = new Field();
shapeField.Name = "Shape";
shapeField.AliasName = "Geometry";
shapeField.Type = esriFieldType.esriFieldTypeGeometry;
shapeField.GeometryDef = geomDef;
Field myAreaTitleAttributeField = new Field();
myAreaTitleAttributeField.Name = "myAreaTitleAttribute";
myAreaTitleAttributeField.Type = esriFieldType.esriFieldTypeString;
Field myStoreAddressAttributeField = new Field();
myStoreAddressAttributeField.Name = "myStoreAddressAttribute";
myStoreAddressAttributeField.Type = esriFieldType.esriFieldTypeString;
Fields fields = new Fields();
fields.FieldArray = new Field[] { oidField, shapeField, myAreaTitleAttributeField, myStoreAddressAttributeField };

// Define a polygon geometry to associate with the FeatureSet
PointN point1_1 = new PointN();
point1_1.SpatialReference = gcs;
point1_1.X = -117.185412;
point1_1.Y = 34.063170;
PointN point1_2 = new PointN();
point1_2.SpatialReference = gcs;
point1_2.X = -117.200570;
point1_2.Y = 34.057196;
PointN point1_3 = new PointN();
point1_3.SpatialReference = gcs;
point1_3.X = -117.189395;
point1_3.Y = 34.052240;
Ring ring1 = new Ring();
// The "last" vertex should equal the "first" vertex. 
ring1.PointArray = new Point[] { point1_1, point1_2, point1_3, point1_1 };
PolygonN poly1 = new PolygonN();
poly1.SpatialReference = gcs;
poly1.RingArray = new Ring[] { ring1 };
Record record1 = new Record();
record1.Values = new object[] { 1, poly1, "[First Dynamic AreaTitleField]", "[First Dynamic StoreAddressField]" };

PointN point2_1 = new PointN();
point2_1.SpatialReference = gcs;
point2_1.X = -117.177401;
point2_1.Y = 34.049393;
PointN point2_2 = new PointN();
point2_2.SpatialReference = gcs;
point2_2.X = -117.186904;
point2_2.Y = 34.043611;
PointN point2_3 = new PointN();
point2_3.SpatialReference = gcs;
point2_3.X = -117.160785;
point2_3.Y = 34.042416;
Ring ring2 = new Ring();
// The "last" vertex should equal the "first" vertex. 
ring2.PointArray = new Point[] { point2_1, point2_2, point2_3, point2_1 };
PolygonN poly2 = new PolygonN();
poly2.SpatialReference = gcs;
poly2.RingArray = new Ring[] { ring2 };
Record record2 = new Record();
record2.Values = new object[] { 2, poly2, "[Second Dynamic AreaTitleField]", "[Second Dynamic StoreAddressField]" };

PointN point3_1 = new PointN();
point3_1.SpatialReference = gcs;
point3_1.X = -117.171502;
point3_1.Y = 34.060632;
PointN point3_2 = new PointN();
point3_2.SpatialReference = gcs;
point3_2.X = -117.154933;
point3_2.Y = 34.052656;
PointN point3_3 = new PointN();
point3_3.SpatialReference = gcs;
point3_3.X = -117.150178;
point3_3.Y = 34.062936;
Ring ring3 = new Ring();
// The "last" vertex should equal the "first" vertex. 
ring3.PointArray = new Point[] { point3_1, point3_2, point3_3, point3_1 };
PolygonN poly3 = new PolygonN();
poly3.SpatialReference = gcs;
poly3.RingArray = new Ring[] { ring3 };
Record record3 = new Record();
record3.Values = new object[] { 3, poly3, "[Third Dynamic AreaTitleField]", "[Third Dynamic StoreAddressField]" };

RecordSet rs = new RecordSet();
rs.Fields = fields;
rs.Records = new Record[] { record1, record2, record3 };
DataLayer dataLayer = new DataLayer();
dataLayer.RecordSet = rs;

// Specify custom report header options
KeyValue locationname_header = new KeyValue();
locationname_header.Key = "locationname";
locationname_header.Value = "[locationname field]";
KeyValue subtitle_header = new KeyValue();
subtitle_header.Key = "subtitle";
subtitle_header.Value = "[subtitle field]";

// Create reports and populate with custom report header options
ReportOptions ro1 = new ReportOptions();
ro1.TemplateName = "dandi";
ro1.ReportFormat = "PDF";
ro1.ReportHeader = new KeyValue[] { locationname_header, subtitle_header };
// Specify dynamic report headers by specifying the attribute field names for each
// feature
ro1.AreaTitleField = "myAreaTitleAttribute";
ro1.StoreAddressField = "myStoreAddressAttribute";

ReportOptions ro2 = new ReportOptions();
ro2.TemplateName = "dandi";
ro2.ReportFormat = "S.XML";

// Specify analysis options
TaskOutputType[] outputOptions = new TaskOutputType[] { TaskOutputType.GetReport };

// Specify parameters of SummaryReports task
SummaryReportsParameters reportsParameters = new SummaryReportsParameters();
reportsParameters.ReportOptions = new ReportOptions[] { ro1, ro2 };
reportsParameters.Boundaries = dataLayer;
reportsParameters.token = token;


// Instantiate the BAOReport proxy object to submit the
// request
BAOReport baoReportProxy = new BAOReport();

// Submit the task
TaskResultOutput result = baoReportProxy.SummaryReports(reportsParameters, outputOptions);

// The result.Reports property will contain an array of generated report.  Note the "dynamic" header fields
// which change with each associated study area.

Example (3) Code
VB.NET
' Authentication: Uses Authentication proxy class to generate token.

' Business Analyst Online API Sample credentials.
' NOTE: These credentials are associated with an 
' account which constrains analysis to the
' two ZIP codes in Redlands, CA.
Dim username As String = "BAOAPISAMPLE"
' Substitute user name here
Dim password As String = "baoapisample"
' Substitute password here
Dim auth As New Authentication()
Dim token As String = auth.getToken(username, password)

Dim gcs As SpatialReference = New GeographicCoordinateSystem()
gcs.WKID = 4326
gcs.WKIDSpecified = True

' Define a geometry definition of the FeatureSet (Feature RecordSet)
Dim geomDef As New GeometryDef()
geomDef.GeometryType = esriGeometryType.esriGeometryPolygon
geomDef.SpatialReference = gcs

' Define the attribute fields of the FeatureSet
Dim oidField As New Field()
oidField.Name = "OID"
oidField.AliasName = "Object ID"
oidField.Type = esriFieldType.esriFieldTypeOID
Dim shapeField As New Field()
shapeField.Name = "Shape"
shapeField.AliasName = "Geometry"
shapeField.Type = esriFieldType.esriFieldTypeGeometry
shapeField.GeometryDef = geomDef
Dim myAreaTitleAttributeField As New Field()
myAreaTitleAttributeField.Name = "myAreaTitleAttribute"
myAreaTitleAttributeField.Type = esriFieldType.esriFieldTypeString
Dim myStoreAddressAttributeField As New Field()
myStoreAddressAttributeField.Name = "myStoreAddressAttribute"
myStoreAddressAttributeField.Type = esriFieldType.esriFieldTypeString
Dim fields As New Fields()
fields.FieldArray = New Field() {oidField, shapeField, myAreaTitleAttributeField, myStoreAddressAttributeField}

' Define a polygon geometry to associate with the FeatureSet
Dim point1_1 As New PointN()
point1_1.SpatialReference = gcs
point1_1.X = -117.185412
point1_1.Y = 34.06317
Dim point1_2 As New PointN()
point1_2.SpatialReference = gcs
point1_2.X = -117.20057
point1_2.Y = 34.057196
Dim point1_3 As New PointN()
point1_3.SpatialReference = gcs
point1_3.X = -117.189395
point1_3.Y = 34.05224
Dim ring1 As New Ring()
' The "last" vertex should equal the "first" vertex. 
ring1.PointArray = New Point() {point1_1, point1_2, point1_3, point1_1}
Dim poly1 As New PolygonN()
poly1.SpatialReference = gcs
poly1.RingArray = New Ring() {ring1}
Dim record1 As New Record()
record1.Values = New Object() {1, poly1, "[First Dynamic AreaTitleField]", "[First Dynamic StoreAddressField]"}

Dim point2_1 As New PointN()
point2_1.SpatialReference = gcs
point2_1.X = -117.177401
point2_1.Y = 34.049393
Dim point2_2 As New PointN()
point2_2.SpatialReference = gcs
point2_2.X = -117.186904
point2_2.Y = 34.043611
Dim point2_3 As New PointN()
point2_3.SpatialReference = gcs
point2_3.X = -117.160785
point2_3.Y = 34.042416
Dim ring2 As New Ring()
' The "last" vertex should equal the "first" vertex. 
ring2.PointArray = New Point() {point2_1, point2_2, point2_3, point2_1}
Dim poly2 As New PolygonN()
poly2.SpatialReference = gcs
poly2.RingArray = New Ring() {ring2}
Dim record2 As New Record()
record2.Values = New Object() {2, poly2, "[Second Dynamic AreaTitleField]", "[Second Dynamic StoreAddressField]"}

Dim point3_1 As New PointN()
point3_1.SpatialReference = gcs
point3_1.X = -117.171502
point3_1.Y = 34.060632
Dim point3_2 As New PointN()
point3_2.SpatialReference = gcs
point3_2.X = -117.154933
point3_2.Y = 34.052656
Dim point3_3 As New PointN()
point3_3.SpatialReference = gcs
point3_3.X = -117.150178
point3_3.Y = 34.062936
Dim ring3 As New Ring()
' The "last" vertex should equal the "first" vertex. 
ring3.PointArray = New Point() {point3_1, point3_2, point3_3, point3_1}
Dim poly3 As New PolygonN()
poly3.SpatialReference = gcs
poly3.RingArray = New Ring() {ring3}
Dim record3 As New Record()
record3.Values = New Object() {3, poly3, "[Third Dynamic AreaTitleField]", "[Third Dynamic StoreAddressField]"}

Dim rs As New RecordSet()
rs.Fields = fields
rs.Records = New Record() {record1, record2, record3}
Dim dataLayer As New DataLayer()
dataLayer.RecordSet = rs

' Specify custom report header options
Dim locationname_header As New KeyValue()
locationname_header.Key = "locationname"
locationname_header.Value = "[locationname field]"
Dim subtitle_header As New KeyValue()
subtitle_header.Key = "subtitle"
subtitle_header.Value = "[subtitle field]"

' Create reports and populate with custom report header options
Dim ro1 As New ReportOptions()
ro1.TemplateName = "dandi"
ro1.ReportFormat = "PDF"
ro1.ReportHeader = New KeyValue() {locationname_header, subtitle_header}
' Specify dynamic report headers by specifying the attribute field names for each
' feature
ro1.AreaTitleField = "myAreaTitleAttribute"
ro1.StoreAddressField = "myStoreAddressAttribute"

Dim ro2 As New ReportOptions()
ro2.TemplateName = "dandi"
ro2.ReportFormat = "S.XML"

' Specify analysis options
Dim outputOptions As TaskOutputType() = New TaskOutputType() {TaskOutputType.GetReport}

' Specify parameters of SummaryReports task
Dim reportsParameters As New SummaryReportsParameters()
reportsParameters.ReportOptions = New ReportOptions() {ro1, ro2}
reportsParameters.Boundaries = dataLayer
reportsParameters.token = token


' Instantiate the BAOReport proxy object to submit the
' request
Dim baoReportProxy As New BAOReport()

' Submit the task
Dim result As TaskResultOutput = baoReportProxy.SummaryReports(reportsParameters, outputOptions)

' The result.Reports property will contain an array of generated reports

See Also