Hello lynnew82,
There are a few ways that you could set up a Cognos list to update an Esri Map in a report. The following options describe two different possibilities for setting up this type of interaction. The options use the example of filtering based on 'State Name', but it would be possible to update the map based on other data item values as well.
Please note that Option 2 is not officially supported by Esri Maps for IBM Cognos, and the steps described may not work with all report/map configurations or in future versions of the software (as features and capabilities are modified and updated). I have tried Option 2 in Esri Maps for IBM Cognos 4.3.2 and have found that it works, but altering your report and map in this way is not recommended and is at your own risk.
Option 1: Drill-Through
Set up a report with a list item showing state names, and an Esri Map showing states. Configure a drill-through definition on the 'State Name' column in the list and set the target report to be the same as the source report (so it will reload the same report when the drill-through is invoked). Create a detail filter on the query that is used by the Cognos Shape Layer to filter the states that are shown in the map based on the 'State Name' data item value that is clicked in the list item.
For example:
The filter on the query used for the Cognos Shape Layer could be as follows: [State Name]in?state?
The drill-through definition on the 'State Name' column in the list item would be as follows:
Target report - same as Source report
Parameter - state
Method - Pass data item value
Value - State Name
NOTE: Using this method of updating the map will cause the whole report to be refreshed every time that the drill-through is invoked. Also, unless additional map layers are configured using a different query to symbolize the rest of the states, only the state that is passed in the drill-through will be shown on the map after a drill-through is performed.
Option 2: Highlight and Zoom with HTML Items
Set up a report with a list item showing state names, and an Esri Map showing states.
Unlock the Cognos list item so that the list elements can be edited. Insert four HTML items in the 'State Name' column - three preceding the 'State Name' data item and one following it. Ex: <HTML Item><HTML Item><HTML Item><State Name><HTML Item>
Configure the HTML Items as follows:
First HTML Item - the Source Type should be Text and the HTML should be
<a href = 'javascript:synchFromList(vipReport,"MAP1", "STATE_NAME","
Second HTML Item - the Source Type should be Data Item Value and the Data Item Value should be State Name
Third HTML Item - the Source Type should be Text and the HTML should be
")'>
Fourth HTML Item - the Source Type should be Text and the HTML should be
</a>
Save the report and close Report Studio.
Open the report in Esri Maps Designer and click on the �??Advanced�?? button in the map configuration window.
Paste the following XML immediately below the <userAction/> element in the map XML.
<incomingEvents>
<incomingEvent queryName="MAP1">
<behaviours>
<behaviour id="" type="queryLayer">
<queryLayer mapServiceId="States" layerId="0" returnGeometry="true" isVantageLayer="" geometryType="" outSpatialReference="" spatialRelationship="">
<outFields>
<field>STATE_NAME</field>
</outFields>
</queryLayer>
<behaviours>
<behaviour id="" type="drawGraphic">
<drawGraphic/>
</behaviour>
<behaviour id="" type="zoomToSelection">
<zoomToSelection/>
</behaviour>
</behaviours>
</behaviour>
</behaviours>
</incomingEvent>
</incomingEvents>
Click Save to save the changes, then Save and Close from the configuration window.
Preview the report. When you click a state name in the list the map should now zoom to that state.
NOTE 1: When adding the HTML text for the first HTML Item, keep in mind that the "STATE_NAME" element refers to the name of the field in the map service. If the 'State Name' field name is not called 'STATE_NAME', you must change the HTML text to reflect the name of the field in the map service that you use (ie: if the field name is actually 'NAME', the HTML text must read as follows: <a href = 'javascript:synchFromList(vipReport,"MAP1", "NAME",")
NOTE 2: When adding the XML text to the map specification, the XML text may need to be modified in three locations in order to work with the map service and query - field name, mapServiceId, and layer id. If the 'State Name' field name is not 'STATE_NAME', you must change the name in the field element in the XML text (ie: if the field name is actually NAME, the field element must read as follows: <field>NAME</field>). If the mapServiceId is not 'States', the mapServiceId must be changed to match the mapServiceLayer id of the Cognos Shape Layer that you would like to highlight and zoom-in on (if the Cognos Shape Layer's mapServiceLayer id is 'USA States', the mapServiceID in the XML text must read as follows: mapServiceId="USA States"). Finally, if the layer id of the Cognos Shape Layer is not '0', the layerId in the XML text must be changed to match the layer id of the layer referenced by the Cognos Shape Layer (if the Cognos Shape Layer is configured on layerId=4, then the XML text must read as follows: layerId="4").
I would suggest using Option 1 whenever possible, since this is a supported feature that is unlikely to cause damage to your report and map specifications. Option 2 should only be used when necessary, since this functionality is not officially supported and may not work in all cases. If you think the 'highlight and zoom' behaviour is a type of interaction that would be useful as an official feature in Esri Maps for IBM Cognos, it is important to contact technical support and ask them to add this as a feature request.
Hope that helps!