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);