IBM Cognos Sample Programs

printReport.sln - Print a Report from IBM Cognos Connection

The C# printReport sample program demonstrates how to run and print a report, change printer properties and how to get, add, and delete printers from the content store.


Dependent Files

All associated files are contained in the printReport folder.

How To Run The Sample Program

Double click on the file ../bin/printReport.exe

A window will be opened containing:
    - Run Option command button
    - URL text box
    - Select Print Option combo box
    - Report Path and Name text box
    - Results Display Window
Select a Print Option from the combo box and then click on the 'Run Option' button to run the sample program.

Expected Results

When the getAvailablePrinters option is selected, by default, the Results Display Window will display the first available printer found.
When the addPrinter option is selected, the user will be prompted to type in a name and address for the new printer.
When the deletePrinter option is selected, the user will be prompted to type in a name or accept the default printer name to be deleted.
When the changePrinterName option is selected, the user will be prompted to enter a current printer name or accept the default printer name. Then, the user will be prompted to enter a new printer name.
When the changePrinterAddress option is selected, the user will be prompted to enter a current printer name or accept the default printer name. Then, the user will be prompted to enter a new printer address for this printer.
When the startPrint option is selected, the report specified in the Report Path and Name box will be executed and sent for printing.

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.