Topic
  • 3 replies
  • Latest Post - ‏2012-02-07T06:05:39Z by ThirupathiNathani
Sunchaser
Sunchaser
7 Posts

Pinned topic SDK to email report with multiple parameter

‏2011-02-25T00:05:36Z |
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.
Updated on 2012-02-07T06:05:39Z at 2012-02-07T06:05:39Z by ThirupathiNathani
  • Sunchaser
    Sunchaser
    7 Posts

    Re: SDK to email report with multiple parameter

    ‏2011-02-25T00:10:51Z  
    Just to be sure: I'm talking about multi-parameter prompt, my subject is a little bit wrong.
    Thanks.
  • Sunchaser
    Sunchaser
    7 Posts

    Re: SDK to email report with multiple parameter

    ‏2011-02-27T17:20:49Z  
    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.
  • ThirupathiNathani
    ThirupathiNathani
    1 Post

    Re: SDK to email report with multiple parameter

    ‏2012-02-07T06:05:39Z  
    • Sunchaser
    • ‏2011-02-27T17:20:49Z
    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.
    Hi,
    I am trying to export a report using COGNOS SDK using 3 different parameters of type String, int, int. I am facing issue while sending the parameter value for Int. Could you help me out by giving me small example of how we need to pass Integer values as a prompt value to a report using COGNOS SDK.

    Thanks for your help with this in advance.

    Regards,
    Tirupathi.