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

Send report with multiparameter per email

Started by Sunchaser, 24 Feb 2011 06:09:45 PM

Previous topic - Next topic

Sunchaser

Hi all,
I have been able to move a little bit forward, and I can send as expected a report in PDF format as attached file.
Now, I have a small problem: I need to pass more than one value to the parameters of the report and I'm not able to achieve it.
It could sounds stupid, but ...
Here is a sample of the code I'm using ("inspired" of SDK example of course):

//....
ParameterValue reportParameters[] = new ParameterValue[] {};
ReportParameters repParms = new ReportParameters();
BaseParameter[] prm = repParms.getReportParameters(report, connection);
//....
IF (prm != NULL && prm.length > 0)
{
ParameterValue[] result_prm = new ParameterValue[prm.length];

/* loop on parameters */
FOR( int i = 0, imax = prm.length; i < imax; i++ )
{
/* loop on values */
String baseParams = "value1,value2,value3";
String tempParams[];
String delimiter = ",";
tempParams = baseParams.split(delimiter);

SimpleParmValueItem item;

ParmValueItem[] pvi = new ParmValueItem[tempParams.length];
FOR ( int j = 0, jmax = tempParams.length; j < jmax; j++ )
{
item = new SimpleParmValueItem();
item.setUse(tempParams[j]);
pvi[j] = item;
}

result_prm[i] = new ParameterValue();
result_prm[i].setName(prm[i].getName());
result_prm[i].setValue(pvi);

}

reportParameters = result_prm;
}
//....etc

The result is that the report seems not so happy with the values I'm sending him, and fails of course.

What is the good technic to achieve this ?

Thanks in advance,
vinc.

Sunchaser

Hi all,

My question was not "usefull": I have simply missed the fact that It seems that the parameters sent in this way were "Strings", when I was waiting for "Integer" on the report side.
I'm too stupid...

So, everything is ok now.