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

Using Cognos SDK for running and saving reports to file system - Issue

Started by Kathir, 11 Dec 2013 01:34:41 AM

Previous topic - Next topic

Kathir

Dear experts,

I have a requirement to run and save report (pdf format) to the file system.  The code which I had written some time back was working fine with out any issue, and is now failing on the same environment.

Even I tried reinstalling Cognos BI server, and tried various combination of run options, but no luck.

I have Cognos 10.1.1  32 bit - Windows installed on my dev environment.

Here are the options which are being passed, and the error message I am getting.

I have gone through the SDK guide, and did googling as well, but nothing helped so far.

Please help me with this.

Error

SOAP-ENV:Client,  Fault String - CNC-BAL-0503 The Client has failed.
SOAP-ENV:detail
error Code: CNC-BAL-0502 Error Number: MSG_DS_INVALID_PROPERTIES
Error Message : CNC-DS-0024 Unable to write the report output because one or more output properties are missing or invalid

Run options being passed

/* Setting run options  */
      /* option to save output */
     
      RunOptionBoolean repSaveOutput = new RunOptionBoolean();
      repSaveOutput.setName(RunOptionEnum.saveOutput);
      repSaveOutput.setValue(false);
      reportRunOptions[0] = repSaveOutput;
     
      RunOptionBoolean repArchiveOutput = new RunOptionBoolean();
      repArchiveOutput.setName(RunOptionEnum.archive);
      repArchiveOutput.setValue(true);
      reportRunOptions[1] = repArchiveOutput;
     
      RunOptionBoolean repPrompt = new RunOptionBoolean();
      repPrompt .setName(RunOptionEnum.prompt);
      repPrompt .setValue(false);  // disable prompting for values, as filters are being passed through SDK for report generation
      reportRunOptions[2] = repPrompt ;

      /* option to set the archive location */
      ArchiveOptionSearchPathSingleObject repArchive = new ArchiveOptionSearchPathSingleObject();
      repArchive.setName(ArchiveOptionEnum.archiveLocation);
      repArchive.setValue(new SearchPathSingleObject(reportSavePathCS));   // "/configuration/archiveLocation[@name='" + orgName + "']"
      reportRunOptions[3] = repArchive;

      /* Setting the file name for saved report */
      ArchiveOptionString repName = new ArchiveOptionString();
      repName.setName(ArchiveOptionEnum.filenameStub);
      repName.setValue(reportSaveName.toString());// reportName_OrgName_Date
      reportRunOptions[4] = repName;

      /* option to resolve conflict during file save */
      ArchiveOptionConflictResolution conflictResolution = new ArchiveOptionConflictResolution();
      conflictResolution.setName(ArchiveOptionEnum.conflictResolution);
      conflictResolution.setValue(ArchiveConflictResolutionEnum.replace);
      reportRunOptions[5] = conflictResolution;

      /* option to choose the output format e.g., pdf, html, csv */
      RunOptionStringArray repOutputFormat = new RunOptionStringArray();
      repOutputFormat.setName(RunOptionEnum.outputFormat);
      repOutputFormat.setValue(new String[] {reportOutputFormat});  //pdf
      reportRunOptions[6] = repOutputFormat;

      /* set report orientation ( only for PDF format) */
      RunOptionString repOrientation = new RunOptionString();
      repOrientation.setName(RunOptionEnum.outputPageOrientation);
      repOrientation.setValue(reportOutputPageOrientation);  // landscape
      reportRunOptions[7] = repOrientation;

     
      /* set report output Locale */     
      RunOptionLanguageArray repOutputLocale = new RunOptionLanguageArray();
      repOutputLocale.setName(RunOptionEnum.outputLocale);
      repOutputLocale.setValue( new String[] {reportOutputLocale});  // "fr-fr"
      reportRunOptions[8] = repOutputLocale;
     
      /* option to choose the primary time period threshold to wait till the report is generated */
      AsynchOptionInt primaryWaitValue = new AsynchOptionInt();
      primaryWaitValue.setName(AsynchOptionEnum.primaryWaitThreshold);
      primaryWaitValue.setValue(ASYNC_OPTION_PRIMARY_WAIT_THRESHOLD); // 7 secs
      reportRunOptions[9] = primaryWaitValue;

      /* option to choose the secondary time period threshold to wait till the report is generated */
      AsynchOptionInt secondaryWaitValue = new AsynchOptionInt();
      secondaryWaitValue.setName(AsynchOptionEnum.secondaryWaitThreshold);
      secondaryWaitValue.setValue(ASYNC_OPTION_SECONDARY_WAIT_THRESHOLD);  // 30 secs
      reportRunOptions[10] = secondaryWaitValue;

Following 2 Runoptions were recently added, thinking that it will resolve the issue observed, and output Locale option is a requirement.

      RunOptionBoolean repSaveOutput = new RunOptionBoolean();
      repSaveOutput.setName(RunOptionEnum.saveOutput);
      repSaveOutput.setValue(false);
      reportRunOptions[0] = repSaveOutput;

      RunOptionBoolean repPrompt = new RunOptionBoolean();
      repPrompt .setName(RunOptionEnum.prompt);
      repPrompt .setValue(false);  // disable prompting for values, as filters are being passed through SDK for report generation
      reportRunOptions[2] = repPrompt ;

      /* set report output Locale */     
      RunOptionLanguageArray repOutputLocale = new RunOptionLanguageArray();
      repOutputLocale.setName(RunOptionEnum.outputLocale);
      repOutputLocale.setValue( new String[] {reportOutputLocale});  // "fr-fr"
      reportRunOptions[8] = repOutputLocale;

Thanks for your time in advance.

Thanks,

Kathir

Kathir

Could any of you throw some light on why this error is being thrown, when attempted to run and save report to file system.

Thanks,
Kathir