Wednesday, December 16, 2009

Installation of Cognos8.4 with Oracle Database and Apache Http Server


Step 1

Install Cognos components. This will take a lot and I recommend to restart the computer between every three components or so, in order to clear the cache, or whatever it is that it makes it run slower.
1.1 Create a folder Cognos in C drive or D drive and copy all the zip files from the installation CD to that folder.
1.2  Unzip the zip files in Cognos folder ( For example, right click the zip file Cognos 8 BI Server 8.3.7z --> ZipGenius --> Extract here, to Cognos 8 BI Server 8.3)
1.3 Open the Win32 folder created under the extracted folder and run the issetup.exe file. Do this for   Cognos 8 BI Server 8.3.7z, Cognos 8 BI Modeling 8.3, Cognos 8 Business Intelligence Samples 8.3.
Step 2

Download OracleXEUniv.exe from Oracle site and install it. Create a new user “cognos” with any password (I chose "cognos" as well) and grant all privileges to it. (NOTE - Character Set of the Database should be UNICODE)
Step 3

Locate ojdbc14.jar in oraclexe\app\oracle\product\10.2.0\server\jdbc\lib and copy it to cognos\c8\webapps\p2pd\WEB-INF\lib
If classes12.jar exists in this folder, delete it or rename it.
Step 4

1.    Download Apache2.2 free from Apache page and install it.
2.    Locate the file httpd.conf file in the installation folder\Conf and add the following text at the bottom:

ScriptAlias /cognos8/cgi-bin "d:/program files/cognos/c8/cgi-bin"

Options FollowSymLinks
AllowOverride FileInfo
Order Allow,Deny
Allow from All


Alias /cognos8 "d:/program files/cognos/c8/webcontent"

Options FollowSymLinks
AllowOverride FileInfo
Order Allow,Deny
Allow from All

Replace d: with c: if necessary.
Restart Apache service.
Step 5

1.    Start Cognos Configuration.
2.    Delete whatever it is under Content Manager and create a new item called “Content Store”, of type Oracle.
3.    Edit the user and password by clicking the pen that appears when selecting the field. User “cognos”, password “cognos”.
4.    Service name is “XE”.
5.    Right click on Content Store and Test.
6.    If all’s right click the green play button to start the service.
7.    You can close Cognos Configuration now, as the service will continue to run in the background.
Step 6

Test that Cognos Connection is working by calling the link http://127.0.0.1/cognos8 or http://localhost/cognos8.
I strongly advise to right click on the Apache icon in the tray bar and select “Open Services”. From this window, set all the Cognos, Oracle and Apache services to start manually instead of automatically. Otherwise all these services will attempt to start automatically on Windows startup and this takes a lot of time.
To start the services manually you have to (in this order):
1.    Click “Start Database” from Oracle start menu
2.    Start Cognos Configuration and click the play button
3.    Start the Apache service from the tray icon

Step 7

1.    You should now import the samples.
2.    Create five users in OracleXE called gosales, gosalesdw, gosaleshr, gosalesmr and gosalesrt. The password should be the same as the user id. Make sure to grant them all the privileges.
3.    Go to cognos\c8\webcontent\samples\datasources\oracle and extract the .gz files.
4.    Under this folder run the following commands:
  imp gosales/gosales@xe file = GOSALES.dmp full=y log=log.txt
  imp gosaleshr/gosaleshr@xe file = GOSALESHR.dmp full=y log=log.txt
  imp gosalesdw/gosalesdw@xe file = GOSALESDW.dmp full=y log=log.txt
  imp gosalesmr/gosalesmr@xe file = GOSALESMR.dmp full=y log=log.txt
  imp gosalesrt/gosalesrt@xe file = GOSALESRT.dmp full=y log=log.txt

Step 8

1.    In Cognos Connection select Cognos Administration and then Configuration.
2.    Click the “New Data Source” button.
3.    Type “gosales” for name and click Next.
4.    Select “Oracle” for type and click Next.
5.    Type “xe” for connection string (small caps needed). Select User ID and Password checkboxes. Enter “gosales” for user ID and the same for password.
6.    Test the connection. In case of failure restart the Oracle database.
7.    If all goes well click Finish.
8.    Repeat the steps for gosalesdw, and the rest.

Step 9

1.    Open Framework Manager.
2.    Open project C:\Program Files\cognos\c8\webcontent\samples\Models\ great_outdoors_sales\ great_outdoors_sales.cpf
3.    If you get an error during opening try replacing localhost:80 with 127.0.0.1:80 in Cognos Configuration gateway URI.
4.    Expand Data Sources and for each data source check that the “Content Manager Datasource” and “Schema” have the same value (gosales, gosalesdw,…).
5.    Also modify the Interface (under Type) to “OR” instead of “OL”.
6.    Test each Data Source. In case of failure restart the Oracle database. Save your changes to the project file.
7.    Expand Packages and publish each package (right click -> publish packages..).
8.    Ignore the errors.
9.    Save and exit.
10.    Do the same for project C:\Program Files\cognos\c8\webcontent\samples\Models\ great_outdoors_warehouse\great_outdoors_warehouse.cpf

Step 10

1.    Copy Cognos_Samples.zip from c8\webcontent\samples\content to c8\deployment.
2.    Open Cognos Connection and select Cognos Administration -> Configuration -> Content Administration.
3.    Click New Import icon.
4.    Cognos_Samples should appear in the list. Select Next, then Next again.
5.    On the ‘Select the Public Folders Content’ page, select the checkbox to the left of the Cognos_Samples package.
6.    Select Next, Next again, then Import Now.
   

Dynamically Hiding and showing Report columns in cognos report studio by parameter selection

In order to hide or show report columns conditionly you have to use a string variable and assign the values to it then dynamically set the value of the variable according to a parameter chosen by the user.

Steps

1.Create a parameter with choices for the user to choose
2.create a string variable and add values to it same as the parameter choices
3.And write the variable expression
as
if(ParamValue('P_year'))='2009'
then
'2009'
else
'2008'
4.Then go to the properties of report column to show or hide
5.Click the render variable property value
6.choose the string variable as render varaible
7. Then select values so when variable value matches to the selected values the column  will be shown
8.Do the same for all columns to show or hide according to the parameter selected by the user

Tuesday, December 15, 2009

Conditional expressions in Cognos Reportstudio

 Syntax

if(?monthcode?='1')
then
(' January')
else if(?Report Period?='2')
then
(' February')
else if(?Report Period?='3')
then
(' March')
else if(?Report Period?='4')
then
(' April')
.
.
.
.
.

else if(?Report Period?='12')
then
(' December')


Case when syntax
 
case ?monthcode?
When 1 then 'Jan'
When 2 then 'Feb'
...
When 12 then 'Dec'
end

Upgrde cognos 8.3 to 8.4

I recommend doing a database backup of your content store database. Create a new schema and restore the backup to the new one and use it for the cognos8.4.and when you start 8.4 configuration, it will convert the content store to 8.4.
This avoids the need to do the export all / import all process.If you do the db backup / rename process, all your users & security settings & data sources will still exist in the new content store.
If you use export all, be sure to select all the options - data sources, users, passwords, security settings, etc., etc. Unless you do everything, you'll wind up with an installation that won't allow people into things, etc., etc.
In addition, Export All does not copy individual users' My Folders.
Also, you cannot do a partial restore of an Export All.