COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: JohnIMS on 02 Aug 2007 11:22:07 AM

Title: ReportRunner SDK HELP
Post by: JohnIMS on 02 Aug 2007 11:22:07 AM
Hi,

I am trying to create reports by using the sample reportrunner. But i have two problems.
1- how can i add parameters to the report? I am using this code:
simpleParmValueItem item = new simpleParmValueItem();
parmValueItem[] pvi = new parmValueItem[1];
parameterValue pv = new parameterValue();
item.use = "FARMACIA OTC";
string nome = "P1_Sel_Alvo";
pvi[0] = item;
pv.name = nome;
pv.value = pvi;
but does not work throw an exception.
2- How can i create the report in PDF? I am using an argument that receive the type of the output. And it works with "HTML" and "XML", with "PDF" when try to open the document it give me an error saying that is malformed.
Can u help me guys.
Title: Re: ReportRunner SDK HELP
Post by: cognosfreelancer on 04 Sep 2007 11:05:37 AM
You need to create an array of data type parameterValue and instantiate it with a definite number.
You will then need to pass this array as an argument to the run method of the reportService web service

I have rewritten your code below:

SimpleParmValueItem item = new SimpleParmValueItem();
ParmValueItem pvi[] = new ParmValueItem[1];
parameterValue pv[] = new parameterValue(some number);

pv[0] = new ParameterValue();
pv[0].setName("P1_Sel_Alvo");
...

// Create a new array to contain the values for the parameter.
pvi[0] = item;
pv[0].setValue(pvi);

Get the idea

Post the error message you get when you attempt a PDF rendition.

HTH

NKT