Topic
  • 5 replies
  • Latest Post - ‏2012-07-24T14:15:50Z by SystemAdmin
SystemAdmin
SystemAdmin
217 Posts

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

    Re: Get list of drill targets using Cognos SDK 10

    ‏2012-07-17T09:35:59Z  
    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

    Re: Get list of drill targets using Cognos SDK 10

    ‏2012-07-17T16:20:58Z  
    • murali999
    • ‏2012-07-17T09:35:59Z
    Hi use this code to get the Drillthrough Paths

    <pre class="jive-pre"> 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()); } } } </pre>
    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

    Re: Get list of drill targets using Cognos SDK 10

    ‏2012-07-17T16:28:34Z  
    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?
    PropEnum.paths. Duh.

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

    Re: Get list of drill targets using Cognos SDK 10

    ‏2012-07-18T06:13:35Z  
    PropEnum.paths. Duh.

    Thanks again...works perfectly!
    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

    Re: Get list of drill targets using Cognos SDK 10

    ‏2012-07-24T14:15:50Z  
    • murali999
    • ‏2012-07-18T06:13:35Z
    Hi yes you need to add the "PropEnum.paths" to PropEnum array which is used in the CM query ..
    Regards,
    Murali.
    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.