IBM Cognos Sample Programs

reportrunner.sln - Run a Report and Save the Output in HTML Format.

The C# reportrunner sample program lets you specify a report to be run and the results saved in HTML format.

Requirements:
- IBM Cognos Software Development Kit
- .NET Framework Version 3 or later
- a running IBM Cognos server
- the IBM Cognos samples databases and samples deployment archive must be installed and configured (if you do not specify a report name on the command-line)
- appropriate permissions set up for the Anonymous account, or a user specified on the command-line


Dependent Files

All associated files are contained in the bin directory of the csharp directory.

How To Run The Sample Program

Launch the command window and navigate to the sample program bin directory in the csharp directory.
Type reportrunner.exe
The options for the command are:
-host hostName        Host name of an IBM Cognos server.
     Default: localhost
-port portNumber        Port number of the IBM Cognos server 'host'.
     Default: 9300
-report searchPath        Search path for a report in the content store.
     Default: /content/folder[@name='Samples']/folder[@name='Models']/package[@name='GO Data Warehouse (query)']/folder[@name='SDK Report Samples']/report[@name='Product Description List']
-output outputPath        File name for the output HTML document.
     Default: reportrunner.html
-user userName        User to log on as. Must exist in 'userNamespace'.
     Default: Anonymous
-password userPassword        Password for 'userName' in 'userNamespace'.
     Default: none
-namespace userNamespace        ID of security namespace to log on to.
     Default: none

A new window will be opened.

Expected Results

The report is saved in HTML format with the name specified or the default name reportrunner.html


This sample does not demonstrate working with parameters or prompts. Select a report that does not prompt for parameter values.

Documentation

The IBM Cognos Software Development Kit Developer Guide contains additional information about the samples. See the chapter titled 'Methods' and the appendix titled 'Code Samples and Language-Specific Coding Practices'.

Please note that the samples are not intended to be treated as end-user applications. Refer to the sample code for examples of how to use the API when developing your own applications.