Cognos SDK Guide by BI Centre can be purchased from PayPal.

You will have your own functional Cognos 8 SDK web solution that has been tailored to be scalable and flexible in order to adapt to your unique business requirements and solution architecture.


Tuesday, February 19, 2008

Cognos 8 SDK -- prompt page with optional parameters

If you need to execute a Report Studio report that has optional parameters defined on the prompt page then you should code your Cognos SDK application to pass an empty parameter instead of an empty string.


// parameter values
ParmValueItem pvi[] = new ParmValueItem[1];

// If you pass an empty string to an optional parameter
// it will assume that you want to match an empty string in
// the filter. To get the desired behaviour, pass an empty
// parameter value
if (!inputValue.equalsIgnoreCase("")) pvi[0] = item1;

// Assign the values to the parameter.
params[i] = new ParameterValue();
params[i].setName(prm[i].getName());
params[i].setValue(pvi);