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 write the user defined function in cognos report studio.

Started by gouravatalkar, 28 Jun 2010 01:44:46 AM

Previous topic - Next topic

gouravatalkar

hi i wants to write my own function so that i can pull the desired value i wants from the database

blom0344

You can the define the database function in the database, add it to the model (through the metadata wizard) and use it in a dataitem. When you use the dataitem in a report the function underneath is executed on the database

mvjcognos

Hi,

U can write ur own function in the report studio by sql in the query explorer.
1) Like go to the query explorer from there drag sql object into the query pane.
2) Click on the sql then go to the properties select database to which u r connected.
3) Then double click on the sql then write ur own sql.
4)  Then it will automatically show all the columns in the select statement in the query1.

Regards,
MVJ

blom0344

Using straight SQL is another matter then adding a customized function to your toolset. With outright SQL you bypass the model itself and you will need to make sure that you enable your users to use it.

It really is a violation of the basis concept how Cognos is intended to work. We create models to report against and generate SQL through means of the model. Injecting hardcoded SQL should be a last resort, do not use it in a production environment..