| Package | com.esri.aws.services |
| Class | public class ReportOptions |
| Property | Defined by | ||
|---|---|---|---|
| dataSource : String
The name of the data source to use for creating a report.
| ReportOptions | ||
| reportFormat : String
The format of the report.
| ReportOptions | ||
| reportHeader : Array
The key/value pairs for the header and footer of a report.
| ReportOptions | ||
| dataSource | property |
public var dataSource:StringThe name of the data source to use for creating a report. Required. See Service Finder for valid data sources. Use the name in parenthesis.
| reportFormat | property |
public var reportFormat:StringThe format of the report. Valid values are "excel", "pdf", or "xml".
The default value is "pdf"..
| reportHeader | property |
public var reportHeader:ArrayThe key/value pairs for the header and footer of a report. Default value is null. Use the method getReportHeaderKeys or see Report notes for a list of key names and value descriptions. If you leave a value empty, the corresponding key item does not appear in your report.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:awx="http://www.arcwebservices.com/2007/awx"
pageTitle="Basic Site Demographic Report"
implements="mx.rpc.IResponder"
creationComplete="onComplete()"
>
<mx:Script>
<![CDATA[
import com.esri.aws.awx.geom.GeoPoint;
import com.esri.aws.osgi.framework.ServiceTracker;
import com.esri.aws.osgi.framework.IServiceReference;
import com.esri.aws.services.IReport;
import com.esri.aws.services.ReportInfo;
import com.esri.aws.services.ReportOptions;
import com.esri.aws.services.Site;
import flash.utils.getQualifiedClassName;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.IResponder;
private var m_report:ReportInfo;
private var reportTracker:ServiceTracker;
private function onComplete():void
{
reportTracker = new ServiceTracker(Framework.getInstance().systemContext, getQualifiedClassName(IReport));
reportTracker.open();
}
private function getSiteReport():void
{
var reportService:IReport = reportTracker.getService() as IReport;
if (reportService)
{
var site:Site = new Site();
site.siteLocation = new GeoPoint(-117.18908, 34.055219);
site.ringRadii = [2];
site.ringUnits = "miles";
site.siteName = "Location #1";
var rOptions:ReportOptions = new ReportOptions;
rOptions.dataSource = "ArcWeb:ESRI.TapestryAreaProfile.US";
rOptions.reportFormat='pdf';
reportService.getSiteReports(site,[rOptions],false,this);
m_info.htmlText = "Creating report ...";
}
}
public function result(data:Object):void
{
var reports:ArrayCollection = ArrayCollection(data);
m_report = reports.getItemAt(0) as ReportInfo;
m_info.htmlText = "Site report in " + m_report.reportFormat + " format using the '" + m_report.dataSource
+ "' data source:<br><u><a href='" + m_report.reportURL + "'>" + m_report.reportURL + "</a></u>";
}
public function fault(info:Object):void
{
Alert.show(info.toString());
}
]]>
</mx:Script>
<awx:Framework id="m_framework" apiKey="[MY-API-KEY]">
<awx:ReportActivator/>
</awx:Framework>
<mx:Button click="getSiteReport()" label="Click to create a 2-mile site report" fontSize="14" />
<mx:Text id="m_info" fontSize="14" text=" "/>
</mx:Application>