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

Getting Report parameter Values using the Cognos SDK

Started by swar80, 16 Feb 2009 10:04:08 AM

Previous topic - Next topic

swar80

Hi
I have been using the Cognos SDK and using it i was sucessfully able to retrieve the report list at a given location and the list of parameters for a given report. Now i want to retrieve the parameter values for those parameter.

I tried various things but i am not able to get those.

The parameter values do come from a database table at run time.. How can i extract those values using SDK and display it in a .net Client to my user?


Can any one help me in this?


Thanks
Swar

avitabj

Hi!  This is the code I use....  hth....jean

String reportPath = "your report path here";

PropEnum props[] = new    PropEnum[]{PropEnum.defaultName,
                              PropEnum.objectClass,
                              PropEnum.searchPath,
                              PropEnum.parameters};
         
         
            BaseClass obj [] = connect.oCrn.query(reportPath, props, new Sort[]{}, new QueryOptions());

            for (int i=0; i< obj.length; i++)
            {
               rptInfo = obj.getDefaultName().getValue() + tabChar + obj.getSearchPath().getValue() ;
               ParameterValue rptParams[] = ((ReportView)obj).getParameters().getValue();

               if (rptParams != null && rptParams.length > 0)
               {
                  
                  for (int k=0; k < rptParams.length; k++)
                  {
                     output = rptInfo + tabChar + rptParams[k].getName();
                     ParmValueItem [] rptItems = rptParams[k].getValue();
                     //System.out.println("rptItems length " + rptItems.length);

                     for (int pvct=0; pvct<rptItems.length; pvct++)
                     {
                        currUse = ((SimpleParmValueItem)rptItems[pvct]).getUse();
                        currDisplay = ((SimpleParmValueItem)rptItems[pvct]).getDisplay();

swar80

Hi Jean
Thanks for the response
Just a question is that oCrn object that you mentioned in your code is a CognosReportNet object?

if so the  PDF says that the CognosReportNet method is deprecated...

Can you please comment on the above question?

Thanks
Swaroop