Professional Documents
Culture Documents
Copyright
Copyright 2008 Cognos ULC (formerly Cognos Incorporated). Cognos ULC
is an IBM Company. While every attempt has been made to ensure that the
information in this document is accurate and complete, some typographical
errors or technical inaccuracies may exist. Cognos does not accept
responsibility for any kind of loss resulting from the use of information
contained in this document. This document shows the publication date. The
information contained in this document is subject to change without notice.
Any improvements or changes to the information contained in this document
will be documented in subsequent editions. This document contains
proprietary information of Cognos. All rights are reserved. No part of this
document may be copied, photocopied, reproduced, stored in a retrieval
system, transmitted in any form or by any means, or translated into another
language without the prior written consent of Cognos. Cognos and the
Cognos logo are trademarks of Cognos ULC (formerly Cognos Incorporated)
in the United States and/or other countries. IBM and the IBM logo are
trademarks of International Business Machines Corporation in the United
States, or other countries, or both. All other names are trademarks or
registered trademarks of their respective companies. Information about
Cognos products can be found at www.cognos.com
This document is maintained by the Best Practices, Product and Technology
team. You can send comments, suggestions, and additions to
cscogpp@ca.ibm.com .
Contents
1 INTRODUCTION ............................................................................................ 4
1.1 ........................................................................................................... PURPOSE... 4
1.2 ..................................................................................................... APPLICABILITY... 4
1.3 .................................................................................. EXCLUSIONS AND EXCEPTIONS... 4
2 STARTING OUT WITH THE COGNOS 8 SDK .................................................. 4
3 SDK SAMPLES USING THE ECLIPSE IDE ....................................................... 5
4 SDK SAMPLES USING THE NETBEANS IDE ................................................. 15
5 SDK SAMPLES IN VISUAL STUDIO.............................................................. 25
6 RESOURCES................................................................................................. 30
6.1 .....................................................................................JAVA TOOLS AND TRAINING. 30
6.2 ............................................................................................................. XPATH. 30
6.3 ........................................................................................................ JAVASCRIPT. 30
6.4 ............................................................................................................... SOAP. 30
6.5 ........................................................................ GENERAL WEB SERVICES REFERENCES. 30
1 Introduction
1.1
Purpose
This document is intended to help the reader become more comfortable with
the IBM Cognos 8 Software Development Kit (SDK) using the SDK samples in
conjunction with some of the Integrated Development Environments (IDE) that
are available today. The goal of this document is not to make the reader a
programmer but to make the SDK more accessible to those who want to work
their way through the samples, modify and run an existing program or as a self
training guide.
Please note that the IDEs covered in this document do not construe an
endorsement over other IDEs that are available. If the reader prefers to use
another IDE, the reader is encouraged to submit a document to the Cognos
Proven Practices group that shows how to use that IDE to set up, build and run
the IBM Cognos 8 SDK samples.
1.2
Applicability
To those new to working with the IBM Cognos 8 SDK on any of the supported
platforms.
1.3
Eclipse comes with named sets of screens bundled together for particular
purposes. These sets are called perspectives. The Java perspective, shown
below, is the default. If, for some reason, the Java perspective is not
displayed, redisplay it by navigating to Window -> Open Perspective -> Java
Perspective.
Create a project in Eclipse by navigating to File -> New -> Project -> Java
Project. Choose a Java Project, and press the Next button.
10
Eclipse will automatically build the project once it is defined. Note that there is
an option to specify the default output folder.
11
Choose the Libraries tab. Notice that the IBM Cognos specific jar files have
been included in the project. Also note the buttons on the right hand side
which allows new libraries and jar files to be added to a project as required.
Press the Finish button.
Eclipse has now built the project. From the Package Explorer, expand the
c8Samples project
12
13
As can be seen, there are a several individual programs contained within the
single project. In addition to being able to run theses programs from the
Eclipse IDE, these programs can also be run from from the command line using
run.bat in Windows or run.sh in Unix or Linux.
This example will run the runreport sample program from within the Eclipse
IDE.
Highlight runreport in the Package Explorer, right click and select Run As ->
Run
The Run dialog appears. To run the program, set the Main class field to
14
15
The results of the program appear in the Console window on the lower part
of the page. The output shows the program connecting to a Cognos 8
dispatcher, running the report, and reporting the results.
16
17
Name the project and specify the name of the directory where the project is to
be kept.
Press Next.
18
In the Existing Sources dialog, press Add Folder. Navigate to the folder where
the Java SDK samples were installed and select it.
Press the Finish button.
19
On the left hand side in the Projects pane, expand the project that was just
created. Right click on the project and select Properties item to open the
Project Properties window.
20
Select the libraries category from the Project Properties window. Press the Add
Jar/Folder button on the right hand side, navigate to the directory <c8
install>/bin and select all of the .jar files that begin with CAM. Press Open.
21
Select the libraries category from the Project Properties window. Press the Add
Jar/Folder button on the right hand side, navigate to <c8 install>/sdk/java/lib
and select all of the .jar files you find there. Press Open.
22
23
To run the runreport program, select runreport in the Projects pane. From the
menu bar, choose Run > Run Main Project
24
25
26
27
In the Solution Explorer pane, select the reportrunner program. Expand the
folder to see the csharp_reportrunner_Explain.html and click on it to view the
contents. This file contains instructions on how to build and run this sample
program.
28
29
Here the executing program reports the connect to the dispatcher, the report
being executed and the end result.
30
6 Resources
The reader may find that the following links contain information that is useful
when developing applications using the IBM Cognos 8 SDK.
6.1
6.2
XPATH
http://www.w3schools.com/xpath/default.asp
http://www.zvon.org/xxl/XPathTutorial/General/examples.html
6.3
JavaScript
http://www.w3schools.com/js/default.asp
http://www.ecma-international.org/publications/standards/Ecma262.htm
6.4
SOAP
6.5
http://www.w3schools.com/soap/default.asp
http://www.w3.org/TR/soap/
Microsoft SOAP Toolkit 3.0