Select to view content in your preferred language

Select and Export features. eSearch?

665
4
Jump to solution
07-24-2012 04:11 PM
JosephAccardi
Regular Contributor
I'm looking to add a simple tool to my FV3.0 app that will allow a user to select features of a layer and export them out to a tabular database (i.e. Excel). I'm looking for a cross between the basic search tool which allows you to select layers graphically and Robert's eSearch that allows you to export the selected features. I started working with the eSearch widget and I can't figure out how to strip it down so the user can only graphically search layers and export out the results. Any ideas?

Thanks
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Joe,

   If you leave something like this in the SearchWidget.xml then it works fine:

<?xml version="1.0" ?> <!-- See Enhanced Search Widget XML Configuration.pdf for detailed explanation --> <configuration>     <layers>         <layer>             <definitionexpression></definitionexpression>             <enableexport>false</enableexport>             <name>Traffic Cameras</name>             <url>http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2</url>             <expressions>                 <expression alias="Traffic Camera Description" textsearchlabel="Search Traffic Cameras by Location...">                     <values>                         <value prompt="Example: I-71" userlist="I-71,I-64">upper(DESCRIPTION) LIKE upper('[value]%')</value>                     </values>                 </expression>             </expressions>             <graphicalsearchlabel>Use one of the graphical search tools to select Traffic Cameras</graphicalsearchlabel>             <spatialsearchlayer>true</spatialsearchlayer>             <titlefield>DESCRIPTION</titlefield>             <fields all="false">                 <field name="DESCRIPTION" alias="Description" gridfield="true" />                 <field name="URL" alias="Show Image" hyperlinkgridfield="true"                     hyperlinkaliastext="Get Traffic Image" visible="false" />                 <field name="ONLINE" alias="Online" gridfield="true"                     gridfieldonly="false" />                 <field name="LAST_UPDATED" alias="Last Updated" gridfield="true"                     gridfieldonly="false" dateformat="MM/DD/YYYY" useutc="true" />             </fields>             <links>                 <link alias="View Traffic Photo">                     <![CDATA[{URL}]]>                     <icon><![CDATA[assets/images/i_camera.png]]></icon>                 </link>             </links>             <zoomscale>5000</zoomscale>             <queryattachments>false</queryattachments>         </layer>     </layers>     <tables /><!-- This section is ONLY for tables (i.e. data that has no geometry)! -->              <spatialrelationships>         <!-- possible spatial relationships esriSpatialRelIntersects | esriSpatialRelContains              | esriSpatialRelCrosses | esriSpatialRelEnvelopeIntersects | esriSpatialRelIndexIntersects              | esriSpatialRelOverlaps | esriSpatialRelTouches | esriSpatialRelWithin currently              unavailable: esriSpatialRelRelation -->         <spatialrelationship>             <name>esriSpatialRelContains</name>             <label>entirely contained in</label>         </spatialrelationship>         <spatialrelationship>             <name>esriSpatialRelIntersects</name>             <label>interssected by</label>         </spatialrelationship>         <spatialrelationship>             <name>esriSpatialRelEnvelopeIntersects</name>             <label>intersected by envelop of</label>         </spatialrelationship>     </spatialrelationships>     <bufferunits>         <bufferunit>             <name>UNIT_FOOT</name>             <label>Feet</label>         </bufferunit>         <bufferunit>             <name>UNIT_STATUTE_MILE</name>             <label>Miles</label>         </bufferunit>         <bufferunit>             <name>UNIT_METER</name>             <label>Meters</label>         </bufferunit>         <bufferunit>             <name>UNIT_KILOMETER</name>             <label>Kilometers</label>         </bufferunit>     </bufferunits>     <enabledatagridinteractionwithwidget>true</enabledatagridinteractionwithwidget>     <toleranceforpointgraphicalselection>6</toleranceforpointgraphicalselection><!-- value is in screen pixels -->     <tolerancebydefault>false</tolerancebydefault>     <spatialreference>102003</spatialreference>     <zoomscale>2400</zoomscale>     <geometryservice>http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer</geometryservice>     <csvseparator>,</csvseparator>     <disablebuttons>text,spatial,datagrid</disablebuttons><!--possible values one or more not all four search types comma separated text,graphic,spatial,grid,datagrid -->     <defaultselectionoption>graphicalInput</defaultselectionoption><!--possible values only one graphicalInput or textInput or spatialInput -->     <enabledrawgraphicbutton>true</enabledrawgraphicbutton>     <enablebuffergraphicbutton>true</enablebuffergraphicbutton>     <selectedgraphicaltool></selectedgraphicaltool><!-- possible values are extent or polygon or mappoint or polyline or nothing -->     <multipartgraphicsearch>true</multipartgraphicsearch>     <floatorfixed>float</floatorfixed><!-- possible values are fixed and float -->     <relatetooltip>Show Relates</relatetooltip>     <relateicon>widgets/eSearch/assets/images/i_relate.png</relateicon>     <labels>         <bufferusergraphics>Buffer Graphic</bufferusergraphics>         <norelatesfound>No related features found for: </norelatesfound>         <norelatesfoundalerttitle>No Results</norelatesfoundalerttitle>         <addtolerance>Add search tolerance to point selection</addtolerance>         <existingdrawgraphicslabel>Use Existing eDraw Widget Graphics</existingdrawgraphicslabel>         <existingbuffergraphicslabel>Use Existing Point Buffer Widget Graphics</existingbuffergraphicslabel>         <graphicalsearchlabel>Graphical Search</graphicalsearchlabel>         <textsearchlabel>Text Search</textsearchlabel>         <resultslabel>Results</resultslabel>         <layerlabel>Search Layer:</layerlabel>         <layerfieldlabel>Search Layer Field:</layerfieldlabel>         <nolayerlabel>No search layer defined.</nolayerlabel>         <submitlabel>Search</submitlabel>         <pointlabel>Select by Point</pointlabel>         <linelabel>Select by Line</linelabel>         <rectanglelabel>Select by Rectangle</rectanglelabel>         <polygonlabel>Select by Polygon</polygonlabel>         <clearlabel>Clear</clearlabel>         <loadinglabel>Loading...</loadinglabel>         <selectionlabel>Features Selected:</selectionlabel>         <gridresultslabel>Show Results in Grid</gridresultslabel>         <csvdefaultname>Selected Records</csvdefaultname>         <relatescsvdefaultname>Related Records</relatescsvdefaultname>         <exportbtnlabel>Export...</exportbtnlabel>         <export2csvoptionlabel>Export to CSV...</export2csvoptionlabel>         <export2txtoptionlabel>Export to Txt...</export2txtoptionlabel>         <bufferlabel>apply a search distance:</bufferlabel>         <spatialsearchlabel>Spatial search</spatialsearchlabel>         <applybufferlabel>Apply buffer</applybufferlabel>         <searchlayerlabel>Search entities of:</searchlayerlabel>         <enablemultipartsearch>enable multi-part graphics</enablemultipartsearch>         <zoomalllabel>Zoom</zoomalllabel>         <zoomalltip>Zoom to all results</zoomalltip>         <bufferalpha>Adjust buffer alpha</bufferalpha>         <buffercolor>Select buffer color</buffercolor>     </labels>     <symbols>         <simplefillsymbol color="0xff0000" alpha="0.5">             <outline color="0xff0000" alpha="0.8" width="2" />         </simplefillsymbol>         <!-- You can have one or the other, either simplemarkersymbol or picturemarkersymbol              defined for your point results NOT BOTH. picturemarkersymbol will override              simplemarkersymbol if you do not have it commented out. -->         <!-- <simplemarkersymbol style="square" size="12" color="0xff0000" alpha="0.5"              xoffset="0" yoffset="0" angle="0"> <outline style="solid" color="0x000000"              alpha="1" width="1"/> </simplemarkersymbol> -->         <picturemarkersymbol url="assets/images/i_search.png" height="30" width="30" xoffset="0" yoffset="0" />         <simplelinesymbol color="0xff0000" alpha="0.8" width="2" />     </symbols> </configuration>

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Joseph,

  Have you not seem the disablebuttons element in the Enhanced Search Widget XML Configuration.pdf documentation?
0 Kudos
JosephAccardi
Regular Contributor
Thank you Robert. I must have missed that part of the documentation. I only have one layer that I need to be searched graphically and exported out, so I deleted all but one of the layer samples included in your code. However, when I delete the expression and tables sections of the code the widget fails to start. Can I delete sections of the sample code that isn't relevant to my usage or should I just eliminate the values in each text string?

Thanks for your help on this.

Joe
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Joe,

   If you leave something like this in the SearchWidget.xml then it works fine:

<?xml version="1.0" ?> <!-- See Enhanced Search Widget XML Configuration.pdf for detailed explanation --> <configuration>     <layers>         <layer>             <definitionexpression></definitionexpression>             <enableexport>false</enableexport>             <name>Traffic Cameras</name>             <url>http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2</url>             <expressions>                 <expression alias="Traffic Camera Description" textsearchlabel="Search Traffic Cameras by Location...">                     <values>                         <value prompt="Example: I-71" userlist="I-71,I-64">upper(DESCRIPTION) LIKE upper('[value]%')</value>                     </values>                 </expression>             </expressions>             <graphicalsearchlabel>Use one of the graphical search tools to select Traffic Cameras</graphicalsearchlabel>             <spatialsearchlayer>true</spatialsearchlayer>             <titlefield>DESCRIPTION</titlefield>             <fields all="false">                 <field name="DESCRIPTION" alias="Description" gridfield="true" />                 <field name="URL" alias="Show Image" hyperlinkgridfield="true"                     hyperlinkaliastext="Get Traffic Image" visible="false" />                 <field name="ONLINE" alias="Online" gridfield="true"                     gridfieldonly="false" />                 <field name="LAST_UPDATED" alias="Last Updated" gridfield="true"                     gridfieldonly="false" dateformat="MM/DD/YYYY" useutc="true" />             </fields>             <links>                 <link alias="View Traffic Photo">                     <![CDATA[{URL}]]>                     <icon><![CDATA[assets/images/i_camera.png]]></icon>                 </link>             </links>             <zoomscale>5000</zoomscale>             <queryattachments>false</queryattachments>         </layer>     </layers>     <tables /><!-- This section is ONLY for tables (i.e. data that has no geometry)! -->              <spatialrelationships>         <!-- possible spatial relationships esriSpatialRelIntersects | esriSpatialRelContains              | esriSpatialRelCrosses | esriSpatialRelEnvelopeIntersects | esriSpatialRelIndexIntersects              | esriSpatialRelOverlaps | esriSpatialRelTouches | esriSpatialRelWithin currently              unavailable: esriSpatialRelRelation -->         <spatialrelationship>             <name>esriSpatialRelContains</name>             <label>entirely contained in</label>         </spatialrelationship>         <spatialrelationship>             <name>esriSpatialRelIntersects</name>             <label>interssected by</label>         </spatialrelationship>         <spatialrelationship>             <name>esriSpatialRelEnvelopeIntersects</name>             <label>intersected by envelop of</label>         </spatialrelationship>     </spatialrelationships>     <bufferunits>         <bufferunit>             <name>UNIT_FOOT</name>             <label>Feet</label>         </bufferunit>         <bufferunit>             <name>UNIT_STATUTE_MILE</name>             <label>Miles</label>         </bufferunit>         <bufferunit>             <name>UNIT_METER</name>             <label>Meters</label>         </bufferunit>         <bufferunit>             <name>UNIT_KILOMETER</name>             <label>Kilometers</label>         </bufferunit>     </bufferunits>     <enabledatagridinteractionwithwidget>true</enabledatagridinteractionwithwidget>     <toleranceforpointgraphicalselection>6</toleranceforpointgraphicalselection><!-- value is in screen pixels -->     <tolerancebydefault>false</tolerancebydefault>     <spatialreference>102003</spatialreference>     <zoomscale>2400</zoomscale>     <geometryservice>http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer</geometryservice>     <csvseparator>,</csvseparator>     <disablebuttons>text,spatial,datagrid</disablebuttons><!--possible values one or more not all four search types comma separated text,graphic,spatial,grid,datagrid -->     <defaultselectionoption>graphicalInput</defaultselectionoption><!--possible values only one graphicalInput or textInput or spatialInput -->     <enabledrawgraphicbutton>true</enabledrawgraphicbutton>     <enablebuffergraphicbutton>true</enablebuffergraphicbutton>     <selectedgraphicaltool></selectedgraphicaltool><!-- possible values are extent or polygon or mappoint or polyline or nothing -->     <multipartgraphicsearch>true</multipartgraphicsearch>     <floatorfixed>float</floatorfixed><!-- possible values are fixed and float -->     <relatetooltip>Show Relates</relatetooltip>     <relateicon>widgets/eSearch/assets/images/i_relate.png</relateicon>     <labels>         <bufferusergraphics>Buffer Graphic</bufferusergraphics>         <norelatesfound>No related features found for: </norelatesfound>         <norelatesfoundalerttitle>No Results</norelatesfoundalerttitle>         <addtolerance>Add search tolerance to point selection</addtolerance>         <existingdrawgraphicslabel>Use Existing eDraw Widget Graphics</existingdrawgraphicslabel>         <existingbuffergraphicslabel>Use Existing Point Buffer Widget Graphics</existingbuffergraphicslabel>         <graphicalsearchlabel>Graphical Search</graphicalsearchlabel>         <textsearchlabel>Text Search</textsearchlabel>         <resultslabel>Results</resultslabel>         <layerlabel>Search Layer:</layerlabel>         <layerfieldlabel>Search Layer Field:</layerfieldlabel>         <nolayerlabel>No search layer defined.</nolayerlabel>         <submitlabel>Search</submitlabel>         <pointlabel>Select by Point</pointlabel>         <linelabel>Select by Line</linelabel>         <rectanglelabel>Select by Rectangle</rectanglelabel>         <polygonlabel>Select by Polygon</polygonlabel>         <clearlabel>Clear</clearlabel>         <loadinglabel>Loading...</loadinglabel>         <selectionlabel>Features Selected:</selectionlabel>         <gridresultslabel>Show Results in Grid</gridresultslabel>         <csvdefaultname>Selected Records</csvdefaultname>         <relatescsvdefaultname>Related Records</relatescsvdefaultname>         <exportbtnlabel>Export...</exportbtnlabel>         <export2csvoptionlabel>Export to CSV...</export2csvoptionlabel>         <export2txtoptionlabel>Export to Txt...</export2txtoptionlabel>         <bufferlabel>apply a search distance:</bufferlabel>         <spatialsearchlabel>Spatial search</spatialsearchlabel>         <applybufferlabel>Apply buffer</applybufferlabel>         <searchlayerlabel>Search entities of:</searchlayerlabel>         <enablemultipartsearch>enable multi-part graphics</enablemultipartsearch>         <zoomalllabel>Zoom</zoomalllabel>         <zoomalltip>Zoom to all results</zoomalltip>         <bufferalpha>Adjust buffer alpha</bufferalpha>         <buffercolor>Select buffer color</buffercolor>     </labels>     <symbols>         <simplefillsymbol color="0xff0000" alpha="0.5">             <outline color="0xff0000" alpha="0.8" width="2" />         </simplefillsymbol>         <!-- You can have one or the other, either simplemarkersymbol or picturemarkersymbol              defined for your point results NOT BOTH. picturemarkersymbol will override              simplemarkersymbol if you do not have it commented out. -->         <!-- <simplemarkersymbol style="square" size="12" color="0xff0000" alpha="0.5"              xoffset="0" yoffset="0" angle="0"> <outline style="solid" color="0x000000"              alpha="1" width="1"/> </simplemarkersymbol> -->         <picturemarkersymbol url="assets/images/i_search.png" height="30" width="30" xoffset="0" yoffset="0" />         <simplelinesymbol color="0xff0000" alpha="0.8" width="2" />     </symbols> </configuration>
0 Kudos
JosephAccardi
Regular Contributor
Thanks for clairifing that for me!
0 Kudos