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

SDK Run Report issues

Started by henry555, 13 Feb 2008 03:47:08 PM

Previous topic - Next topic

henry555

When I run a report with saveOutput = false and OutputEncapsulationEnum.URL, i get an error when redirecting to the URL:

DPR-ERR-2069 : There are no report output versions available for this report.

What could be the reason for this? I've included a part of my code:





String reportPath =
"/content/package[@name='GO Sales and Retailers']"
+ "/folder[@name='Documentation Report Samples']/"
+ "report[@name='Show Detail Rows and Summaries']";

String userName = "someone";
String userPassword = "somepass";
String userNamespace = "default";
String serverHost = "localhost";
String serverPort = "9300";
String Cognos_URL = "http://" + serverHost + ":" + serverPort + "/p2pd/servlet/dispatch";

ReportService_ServiceLocator reportServiceLocator = new ReportService_ServiceLocator();
ReportService_Port repService = null;
try {
repService = reportServiceLocator.getreportService(new URL(Cognos_URL));
} catch (MalformedURLException ex) {
ex.printStackTrace();
} catch (ServiceException ex) {
ex.printStackTrace();
}
if ((userName.length() > 0) && (userPassword.length() > 0) && (userNamespace.length() > 0)) {
setUpHeader(repService, userName, userPassword, userNamespace);
}

// Set up the report parameters.
ParameterValue parameters[] = new ParameterValue[] {};

Option runOptions[] = new Option[5];

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

RunOptionStringArray outputFormat = new RunOptionStringArray();
outputFormat.setName(RunOptionEnum.outputFormat);
outputFormat.setValue(new String[] { "HTML" });
runOptions[1] = outputFormat;

RunOptionOutputEncapsulation outputEncapsulation = new RunOptionOutputEncapsulation();
outputEncapsulation.setName(RunOptionEnum.outputEncapsulation);
outputEncapsulation.setValue(OutputEncapsulationEnum.URL);
runOptions[2] = outputEncapsulation;

AsynchOptionInt primaryWait = new AsynchOptionInt();
primaryWait.setName(AsynchOptionEnum.primaryWaitThreshold);
primaryWait.setValue(0);
runOptions[3] = primaryWait;

AsynchOptionInt secondaryWait = new AsynchOptionInt();
secondaryWait.setName(AsynchOptionEnum.secondaryWaitThreshold);
secondaryWait.setValue(0);
runOptions[4] = secondaryWait;

try {
AsynchReply res = repService.run(new SearchPathSingleObject(reportPath), parameters, runOptions);
if (res.getStatus() == AsynchReplyStatusEnum.complete) {
AsynchDetailReportOutput reportOutput = null;
for (int i = 0; i < res.getDetails().length; i++) {
if (res.getDetails()[i] instanceof AsynchDetailReportOutput) {
reportOutput = (AsynchDetailReportOutput) res.getDetails()[i];
break;
}
}
String[] data = reportOutput.getOutputPages();
contents = "";
for (int idx = 0; idx < data.length; idx++) {
System.out.println(data[idx]);
contents = data[idx];
}
}
} catch (AxisFault ex) {
String ex_str = Cognos8Exception.convertToString(ex);
System.out.println("SOAP exception!\n");
System.out.println(ex_str);
} catch (Exception ex) {
ex.printStackTrace();
}


tmacfarlane

Could this not be an SDK issue and the cause is within Cognos Connection?  Did you modify the properties of the report itself to save 'x' number of report output versions?

cogno

Hi Henry555,

Can you please share the code for "setUpHeader" function?

Thanks,
Cogno.