Select to view content in your preferred language

How cognos chart broadcast to the esir map?

3306
7
12-23-2012 09:52 PM
lynnwang
Deactivated User
Hi,
   I'm new to use cognos and esri maps for cognos. There is a few question below.
  
   1) I saw the demo about the interactions between the cognos table and esri map. In the demo, once clicked on the State name in a cognos table,the esri map will highlight the State's polygon and zoom to it. How can I make it out in cognos and esri maps?

   2)There is a strange problem.I added a arcgis dynamic map into esri maps.Then I add xy data layer to the esri map.Then either the dynamic layer or xy event layer will show.

   Looking foward to your reply.Thanks.
Tags (3)
0 Kudos
7 Replies
LawrenceCao
New Contributor
1) I saw the demo about the interactions between the cognos table and esri map. In the demo, once clicked on the State name in a cognos table,the esri map will highlight the State's polygon and zoom to it. How can I make it out in cognos and esri maps?
A: Yes, you can make it happen by joining Stat layer and Cognos State query item.

   2)There is a strange problem.I added a arcgis dynamic map into esri maps.Then I add xy data layer to the esri map.Then either the dynamic layer or xy event layer will show.
Q: Is this a question for EM4C?
0 Kudos
lynnwang
Deactivated User
1)yes,I joint them.But how to highlight the states polygon without refresh the whole EM4C?

2)yes,of course. I mean in the EM4C,the dynamic layer and XY Data layer can not show up at the same time.Is it your design?  In the version 4.3.1,everything is ok. But in version 4.3.2,this problem came out.
0 Kudos
FrancesLitt
Deactivated User
Hello lynnew82,

Regarding your second question, it sounds like the coordinate system of the Cognos XY Layer may not match the coordinate system of the ArcGIS dynamic map service that you used as your basemap.  This would result in only one of the layers being readily apparent when you view the map, since the XY Layer points are not distributed properly relative to the basemap.

To fix this issue, you must find out the coordinate system that was used as the reference for the point locations of the Cognos XY Layer.  The dynamic map service that you use as a basemap must match the same coordinate system that is referenced by the Cognos XY Layer points.

One way to test this is to switch the basemap to a map service with a different coordinate system. In the map configuration window, drag ESRI_Imagery_World_2D (from the 'Esri Map Services' folder) to the bottom of the 'Layers' list.  Save and Close and preview your report.  If the Cognos XY Layer shows up properly relative to this basemap, then the points are configured for WKID 4326 (WGS 84).  If the Cognos XY Layer does not show up properly relative to the basemap, or the basemap does not show up at all, open the map configuration window and drag NatGeo_World_Map to the bottom of the 'Layer's list.  Save and Close and preview the report.  If the Cognos XY Layer shows up properly relative to the basemap now, the points are configured for WKID 102100 (Web Mercator).
0 Kudos
lynnwang
Deactivated User
Thank you flitt!
   You are right. I mistake the spatial reference of dynamic map. I only saw sr of each layer in the dynamic map,but forget to check the sr of layers'frame.

    And do you have any ideas about the first question ?
0 Kudos
FrancesLitt
Deactivated User
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!
0 Kudos
lynnwang
Deactivated User
Hi,flitt!
    Thank you very much for your detailed response. It's very helpful.
    I tried two ways. They worked.
    But the Option 2 only works on the Cognos Shape Layer.  Does it mean that Option 2 is not suitable for Cognos XY Layer? So there is no other way but Option 1 to zoom and hightlight the points, isn't it?
0 Kudos
FrancesLitt
Deactivated User
Hello lynnew82,

You are right, Option 2 is only set up to work with Cognos Shape Layers. 

One way to achieve a zoom-in towards a point on the map would be to configure Option 2 for a shape layer (as described previously), but link from a list item displaying point information (site code, retailer name, etc.).  For example, you could click a retailer's site code in the list, and have the map zoom to the state in which that retailer is located.


[INDENT]Here is how you would achieve this effect:
1) Configure a report with Option 2 (as described previously).  Add a Cognos XY Layer to the map as well.

2) Once the zoom-in functionality is working for the Cognos Shape Layer, replace the data item that is displayed in the list (between the html items) with the data item that you would like displayed.
For example, you could replace <State Name> with <Retailer Site Code>:
<HTML Item><HTML Item><HTML Item><State Name><HTML Item> would be changed to
<HTML Item><HTML Item><HTML Item><Retailer Site Code><HTML Item>

Be sure to 'cut' (not 'delete') the State Name data item from the list as the data item needs to be kept in the list's query.  Do not alter the contents of the HTML items.[/INDENT]


As long as the data item that is being passed for the zoom-to action is included in the list's query, it is ok if the data item that is being displayed in the list is different than the data item that is being passed.  This makes it possible to display a point's site code and have the map zoom to the state shape in which that point is located. 

NOTE 1:  The data item that is used as the link must be a unique identifier for the points in the map - each link can only represent a single point on the map.  If the data item that is being used as the link is not a unique identifier (ie: there are three different points associated with the same link in the list) the zoom-to functionality will not work as desired (only one of the points' associated shapes will be zoomed-to).

NOTE 2:  To achieve a better zoom-in effect, configure a Cognos Shape Layer with smaller shapes.  For example, configuring Option 2 for zipcodes rather than states would result in a zoom-in much closer to where the point is located.

As a reminder, altering your report and map specifications as described in Option 2 is not officially supported.  Future versions of the software may not include this functionality and it is advisable to use other methods (using the supported features that are available such as Option 1 described in the previous post) for achieving a similar effect.
0 Kudos