Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
5 replies Latest Post - ‏2012-07-24T14:15:50Z by SystemAdmin
SystemAdmin
SystemAdmin
217 Posts
ACCEPTED ANSWER

Pinned topic Get list of drill targets using Cognos SDK 10

‏2012-07-16T16:03:40Z |
We're using the Cognos SDK 10 to retrieve and display reports in a custom front-end. How do you retrieve the list of target reports referenced in each drill through using the SDK only? findDrillThroughPaths() seems promising but I have no idea how do use it.

Thanks.
Updated on 2012-07-24T14:15:50Z at 2012-07-24T14:15:50Z by SystemAdmin
  • murali999
    murali999
    9 Posts
    ACCEPTED ANSWER

    Re: Get list of drill targets using Cognos SDK 10

    ‏2012-07-17T09:35:59Z  in response to SystemAdmin
    Hi use this code to get the Drillthrough Paths

    
    AuthoredReport r=(AuthoredReport) report[0]; 
    
    if(r.getPaths()!=
    
    null) 
    { NavigationPath [] n=r.getPaths().getValue(); 
    
    if(n !=
    
    null) 
    { 
    
    for(
    
    int p=0; p< n.length ;p++) 
    { BaseClass [] bs=n[p].getTarget(); 
    
    if(bs != 
    
    null ) System.out.println(
    "DrillThroughPaths : "+bs[0].getSearchPath().getValue()); 
    } 
    } 
    }
    
    • SystemAdmin
      SystemAdmin
      217 Posts
      ACCEPTED ANSWER

      Re: Get list of drill targets using Cognos SDK 10

      ‏2012-07-17T16:20:58Z  in response to murali999
      Thanks very much.

      Unfortunately r.getPaths() always returns a NULL, even for a report with drill-throughs. Do I need to add something to my query?
      • SystemAdmin
        SystemAdmin
        217 Posts
        ACCEPTED ANSWER

        Re: Get list of drill targets using Cognos SDK 10

        ‏2012-07-17T16:28:34Z  in response to SystemAdmin
        PropEnum.paths. Duh.

        Thanks again...works perfectly!
        • murali999
          murali999
          9 Posts
          ACCEPTED ANSWER

          Re: Get list of drill targets using Cognos SDK 10

          ‏2012-07-18T06:13:35Z  in response to SystemAdmin
          Hi yes you need to add the "PropEnum.paths" to PropEnum array which is used in the CM query ..
          Regards,
          Murali.
          • SystemAdmin
            SystemAdmin
            217 Posts
            ACCEPTED ANSWER

            Re: Get list of drill targets using Cognos SDK 10

            ‏2012-07-24T14:15:50Z  in response to murali999
            This works perfectly, except if I have multiple drills defined that drill into the same report. For example, if I have two drills defined both of which have target is report "A", then I only get one row returned from getPaths().

            When same the report is displayed in the Cognos Viewer I see two DrillThroughTarget rows added to the drillTargets javascript array. How can I replicate this functionality?

            Thanks.