Topic
10 replies Latest Post - ‏2015-01-22T16:12:14Z by K1R4_Saarang_Deshmukh
SoundBI
SoundBI
1 Post
ACCEPTED ANSWER

Pinned topic Getting source report name for a ReportView using SDK

‏2011-09-30T19:26:24Z |
I'm in the process of upgrading 8.2 reports to 8.4. We have more than 400 report views. I want to find out source report name for a given ReportView using SDK.

1. What query method (CMService or ReportService) need to used to retrive this information?
2. Once I get the result from query, how would I get source report name information? Should it be casted to ReportView class and retrive this information?

Here is the code I'm using to get report details:

PropEnum props] = new PropEnum[ { PropEnum.searchPath, PropEnum.defaultName, PropEnum.userName, PropEnum.base,
PropEnum.objectClass, PropEnum.permissions, PropEnum.parent, PropEnum.name, PropEnum.source};
Sort sortOptions[] = { new Sort()};
sortOptions[0].setOrder(OrderEnum.ascending);
sortOptions[0].setPropName(PropEnum.defaultName);
SearchPathMultipleObject reportsPath = new SearchPathMultipleObject(searchPath);
BaseClass reports[] = connection.getCMService().query(reportsPath,props,sortOptions,new QueryOptions());

It will be pain to go through manullay to findout the source report reference.

Appreaciate help.
Updated on 2012-07-16T13:06:53Z at 2012-07-16T13:06:53Z by SRAVANVADLAMANI
  • DJ6
    DJ6
    1 Post
    ACCEPTED ANSWER

    Re: Getting source report name for a ReportView using SDK

    ‏2012-04-26T18:39:14Z  in response to SoundBI
    Hi,
    Were you able to find a solution for this, I am looking for a solution too, if you have a solution can you please share with me?

    Thanks,
    -dayaa
    • SRAVANVADLAMANI
      SRAVANVADLAMANI
      5 Posts
      ACCEPTED ANSWER

      Re: Getting source report name for a ReportView using SDK

      ‏2012-06-08T16:22:21Z  in response to DJ6
      Hello...

      I am waiting to get such information from a while. Please do let know how to do that?

      Best Regards,
      Sravan
  • murali999
    murali999
    9 Posts
    ACCEPTED ANSWER

    Re: Getting source report name for a ReportView using SDK

    ‏2012-06-12T14:05:01Z  in response to SoundBI
    Hi,
    after executing the CM Query method , just cast the results to rportview and get the base search path..

    > SoundBI wrote:
    > I'm in the process of upgrading 8.2 reports to 8.4. We have more than 400 report views. I want to find out source report name for a given ReportView using SDK.
    >
    > 1. What query method (CMService or ReportService) need to used to retrive this information?
    > 2. Once I get the result from query, how would I get source report name information? Should it be casted to ReportView class and retrive this information?
    >
    > Here is the code I'm using to get report details:
    >
    > PropEnum props] = new PropEnum[ { PropEnum.searchPath, PropEnum.defaultName, PropEnum.userName, PropEnum.base,
    > PropEnum.objectClass, PropEnum.permissions, PropEnum.parent, PropEnum.name, PropEnum.source};
    > Sort sortOptions[] = { new Sort()};
    > sortOptions[0].setOrder(OrderEnum.ascending);
    > sortOptions[0].setPropName(PropEnum.defaultName);
    > SearchPathMultipleObject reportsPath = new SearchPathMultipleObject(searchPath);
    > BaseClass reports[] = connection.getCMService().query(reportsPath,props,sortOptions,new QueryOptions());
    >
    > It will be pain to go through manullay to findout the source report reference.
    >
    > Appreaciate help.

    after executing the query method , just insert this code
    for(int i=0; i< reports.length ; i++)
    {
    if(report[i] instanceof ReportView)
    {
    ReportView rv = (ReportView)report[i];
    if(rv.getBase()!=null )
    {
    String baseSearchPath = rv.getBase().getValue()[0].getSearchPath().getValue();
    System.out.println(" the base report for the report view "+
    report[i].getDefaultName.getValue ()+" is" + baseSearchPath);
    }
    }
    }
    • SRAVANVADLAMANI
      SRAVANVADLAMANI
      5 Posts
      ACCEPTED ANSWER

      Re: Getting source report name for a ReportView using SDK

      ‏2012-07-11T21:56:48Z  in response to murali999
      I tried running the attached code in Cognos 10.1.1 and this code logs in successfully but when it tries to access the Content Store to fetch the Base Report Details it throws the error message (Unable to Authenticate)

      I am attaching the code and mentioning the error log below. Request you to kindly let me know your inputs at the earliest.
      ***************************************************************************
      Helloo!!
      In ContentManagerService!!
      calling cmService!!
      http://lebit1deve01:9082/p2pd/servlet/dispatch
      After cmService
      exited cmService!!
      Byee!!
      Logon Details=<credential><namespace>LDAP</namespace><username">username"</username><password>"password"</password></credential>
      LOGON SUCCESSFUL!!!!!
      rvSearchPath!!
      IN ChangeRVBASE
      Prop enum
      rvSearchPath=/content/folder/folder/folder/reportView
      AxisFault
      faultCode: Client
      faultSubcode:
      faultString: CM-REQ-4342 An error occurred with the client.
      faultActor:
      faultNode:
      faultDetail:
      {http://developer.cognos.com/schemas/bibus/3/}exception:
      <severity>error</severity>
      <errorCode>cmHeaderFault</errorCode>
      <ns1:message>
      <messageString>CM-REQ-4159 Content Manager returned an error in the response header. The error "cmAuthenticateFailed CM-CAM-4005 Unable to authenticate. Check your security directory server connection and confirm the credentials entered at login." can be found in the response SOAP header.</messageString>
      </ns1:message>
      CM-REQ-4342 An error occurred with the client.
      at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
      at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
      at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
      at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
      at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
      at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
      at org.apache.axis.client.Call.invoke(Call.java:2553)
      at org.apache.axis.client.Call.invoke(Call.java:2248)
      at org.apache.axis.client.Call.invoke(Call.java:2171)
      at org.apache.axis.client.Call.invoke(Call.java:1691)
      at com.cognos.developer.schemas.bibus._3.ContentManagerServiceStub.query(ContentManagerServiceStub.java:6352)
      at BaseReportDetail_campassport_071012.changeRVBase(BaseReportDetail_campassport_071012.java:113)
      at BaseReportDetail_campassport_071012.main(BaseReportDetail_campassport_071012.java:150)
      **************************************************************************************************************************
      • murali999
        murali999
        9 Posts
        ACCEPTED ANSWER

        Re: Getting source report name for a ReportView using SDK

        ‏2012-07-12T12:12:46Z  in response to SRAVANVADLAMANI
        Hi Sravan,
        The error is in logon method , in cognos 10 we have to set the BiBus Header
        i had modified your code , try to execute the attached code it should work
        If you got any errors let me know with error details .

        Regards,
        Murali
        • SRAVANVADLAMANI
          SRAVANVADLAMANI
          5 Posts
          ACCEPTED ANSWER

          Re: Getting source report name for a ReportView using SDK

          ‏2012-07-12T13:26:42Z  in response to murali999
          Dear Murali,

          Thank you for the reply. I tried the code using the getResponseHeader method earlier and the axis.jar file we have doesn't have this method causing the java code to throw error message as the symbol getResponseHeader not found. So, I downloaded the latest axis.jar file from org.apache and when I include the downloaded axis.jar file in the classpath now I get the below error message

          **************************************************************************************************************************
          Exception in thread "main" java.lang.NoSuchFieldError: org/apache/axis/enum/Style.RPC
          at com.cognos.developer.schemas.bibus._3.ContentManagerServiceStub.<clinit>(ContentManagerServiceStub.java:25)
          at java.lang.J9VMInternals.initializeImpl(Native Method)
          at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
          at com.cognos.developer.schemas.bibus._3.ContentManagerService_ServiceLocator.getcontentManagerService(ContentManagerService_ServiceLocator.java:43)
          at BaseReportDetails_071212.<init>(BaseReportDetails_071212.java:16)
          at BaseReportDetails_071212.main(BaseReportDetails_071212.java:85)
          **************************************************************************************************************************
          • murali999
            murali999
            9 Posts
            ACCEPTED ANSWER

            Re: Getting source report name for a ReportView using SDK

            ‏2012-07-13T06:33:44Z  in response to SRAVANVADLAMANI
            which version of SDK you are using ?
            if you are using cognos 10 SDK , then there is no need to download latest version of axis.jar it is included in cognos SDK 10 , all you need is to set the classpath to cognos10 SDK lib (all jar files).

            if you are using cognos 8 SDK , then you can not able to connect to the cognos 10 dispatcher , you need to download the cognos 10 SDK.

            Regards,
            Murali
            • SRAVANVADLAMANI
              SRAVANVADLAMANI
              5 Posts
              ACCEPTED ANSWER

              Re: Getting source report name for a ReportView using SDK

              ‏2012-07-13T13:29:21Z  in response to murali999
              Dear Muarli,

              Thank you for your reply.

              We are actually using 8.4.1 SDK and I think this is compatable with Cognos 10 SDK. So, I am not sure why still I get those error message.

              Request you to kindly let me know your suggestion.

              Best Regards,
              Sravan
              • murali999
                murali999
                9 Posts
                ACCEPTED ANSWER

                Re: Getting source report name for a ReportView using SDK

                ‏2012-07-16T11:48:09Z  in response to SRAVANVADLAMANI
                Hi Sravan,

                Cognos 8.4.x SDK is not compatable with cognos 10 , you must use cognos 10.x SDK
                or you must update cognos 8.x SDK to cognos 10 SDK

                there is no way to connect cognos 10 through cognos 8.x SDK ..

                Regards,
                Murali.
                • SRAVANVADLAMANI
                  SRAVANVADLAMANI
                  5 Posts
                  ACCEPTED ANSWER

                  Re: Getting source report name for a ReportView using SDK

                  ‏2012-07-16T13:06:53Z  in response to murali999
                  Dear Murali,

                  Thank you so much for your inputs. I did use the Cognos 10 .jar files and now it is working.

                  Thank you for the help.

                  Best Regards,
                  Sravan
        • This reply was deleted by K1R4_Saarang_Deshmukh 2015-01-22T16:12:39Z.