If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Cognos 8 SDK Copy report

Started by chris.tkd, 16 Sep 2009 05:32:45 AM

Previous topic - Next topic

chris.tkd

Hello,

Im using cognos 8 sdk (java) to copy a report from one place to another on the same server.

The code im using to copy is:

String[] reportPath = {"/content/folder[@name='folder 1']/folder[@name='folder 2']/folder[@name='folder 3']/folder[@name='folder 4']/report[@name='ReportName 1']"};
     
      BaseClass[] obj = new BaseClass[1];
      StringProp path = new StringProp();
      path.setValue(reportPath[0]);
      obj[0] = new com.cognos.developer.schemas.bibus._3.Report();
      obj[0].setSearchPath(path);

      obj = reportRetriever.getReportRetriever().getCmService().copy(obj, new SearchPathSingleObject("/content/folder[@name='folder 1']/folder[@name='folder 2']/folder[@name='folder 3']/folder[@name='bookmarked reports']/report[@name='reportName Bookmarked]"), copyOptions);


The error im getting is:

faultDetail:
        {http://developer.cognos.com/schemas/bibus/3/}exception:
                        <severity>error</severity>
                        <errorCode>cmCopyFailed</errorCode>
                        <ns1:message>
                                <messageString>CM-REQ-4127 An error occurred during a copy operation.</messageString>
                        </ns1:message>
                        <ns1:message>
                                <nestingLevel>1</nestingLevel>
                                <messageString>CM-REQ-4218 The target object &quot;/Public Folders/folder 1/folder 2/folder 3/bookmarked reports/ReportName Bookmarked&quot; was not found.</messageString>
                        </ns1:message>


CM-REQ-4342 An error occurred with the client.

So basically i think its looking for ReportName Bookmarked in the bookmarked reports folder (destination) to try and over write it, this report dosent exist so its giving me an error.

I think the problem is with the target string /content/folder[@name='folder 1']/folder[@name='folder 2']/folder[@name='folder 3']/folder[@name='bookmarked reports']/report[@name='reportName Bookmarked]

I have tried using a target string similar to:

/content/folder[@name='folder 1']/folder[@name='folder 2']/folder[@name='folder 3']/folder[@name='bookmarked reports']/report

(error is target selects multiple objects)

/content/folder[@name='folder 1']/folder[@name='folder 2']/folder[@name='folder 3']/folder[@name='bookmarked reports']/

(error is target cant end with a /)

/content/folder[@name='folder 1']/folder[@name='folder 2']/folder[@name='folder 3']/folder[@name='bookmarked reports']

(target is there is a naming conflict with the destination)

But these all give the errors shown above.

Has anyone got any idea on what im doing wrong?

Thanks,
Chris.