COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => SDK => Topic started by: n_ramesh_in on 14 Jun 2007 10:10:50 AM

Title: Retrieving Report Path
Post by: n_ramesh_in on 14 Jun 2007 10:10:50 AM
Hi All,
Is there any way to retrieve the path of the report stored on cognos server thru the SDK code in java?..Can anyone send me the code snippet?

ramesh
Title: Re: Retrieving Report Path
Post by: that_pesky_guy on 03 Jul 2007 03:41:31 PM
First you have to make sure your call to the query() method includes the appropriate props enumerations:


    BaseClass result = null;
    PropEnum[] props = new PropEnum[]{
        PropEnum.searchPath // add other properties you want in the response to this list
    };
    Sort[] s = {};

    // then call the query() method
    SearchPathMultipleObject spMultiple = new SearchPathMultipleObject();
    spMultiple.setValue(searchPath);
    QueryOptions queryOptions = new QueryOptions();
    try{
        result = cmPort.query(spMultiple, props, s, queryOptions);
    }
    // catch any problems here


Each item in the result array will now have its searchPath property set (if applicable). You can call the item's getSearchPath().getValue() to retrieve the string.