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

how to get prompt values for parameter

Started by cremersstijn, 04 Feb 2009 08:18:37 AM

Previous topic - Next topic

cremersstijn

Is it possible to get the prompt values for a report parameter?
if yes.. how?

greetz & thankz

cremersstijn

I'm still looking for an answer!!

Does anybody know how to solve this?

netanel

Hi,
Populating a prompt with values is done by running a query against the db (unless it has "static choices"). It means you cannot do it by quert() method but only with run() method (with reportService of course).
I can think of a way to do it with Cognos SDK - create some report contains this data-item only, run it as XML, and then reterieve the info from the XML - but the later task is not very easy...
I think the best to do that would be to run this query directly against the DB (using some .Net / Java provider) and get the data as a dataset. However, the result will not consider the FM model design.
But may be I'm wrong and there is a better way to do it with Cognos SDK.

xiska

Hi,

at this stage you need to define what you want.
Do you mean the default promt values you define in the report studio which is a part of the specification? (#1)
Or do you mean the overwriting prompt values of a report specified in connection? (#2)

So the Answer to "if it is possible" is: you can do it with the sdk.

The answer how is not so easy as the prompt values may be different due to user regulations.
To be more precise:
#1 & #2: the values for a prompt may be different because of user rigths.
#1 & #2: only on drop down and lists you may be able do discover the offered values. You be able to get the default or given value but not the entered. Just think about a date prompt.

#1:
here you can use the getSpecification().toString() and then search within the String or parse it into xml to walk through.

#2:
the prompts are a property of reports - this is 20% true. A prompt may also inside of a analysis, query ...
to be more flexible take the master class of them wich is a AuthoredReport which looks like that.
rparams = (AuthoredReport)baseclass.getParameter....
You need to consider that you have several parameternames, some display values per parametername and some values per parametername.
Therefore rparams is something like an array.

Anyway you might be faster using the audit db. As far as i know it also loggs the parameter.

Please inform us about the progress.