A Cognos Report Studio developer can design a report to apply specific filtering on a data item. For example, if a report developer wanted to only return all sale orders that occurred in the city of London then they could design a prompt page that allowed a user to select London as the city parameter item. The sales order query would be filtered based on the selected parameter value.
Knowing the parameters that exist in the report definition is a vital piece of information when executing Cognos Report Studio reports via the Cognos SDK. If the parameter collection is not satisfied then the report will maintain a state of prompting.
Here is a code example that shows the request for a report’s parameter collection. You should not that the report item is an input parameter contained in the search path for the report.
public asynchDetail[] GetParams(string packageName, string reportName, reportService1 rptService)
{
try
{
searchPathSingleObject spSingle = new searchPathSingleObject();
string _pkgName = packageName;
string _rptName = reportName;
spSingle.Value = "/content/package[@name='" + _pkgName + "']/report[@name='" + _rptName + "']";
asynchReply _resParameters = rptService.getParameters(spSingle, new parameterValue[]{},new option[]{});
asynchDetail[] _details = _resParameters.details;
return _details;
}
catch (Exception ex)
{
_ErrMsg = ex.Message.ToString();
return null;
}
}
Now that you have asynchDetail[] object you can access the report’s parameter collection information.