Wednesday, 1 November 2017

Cognos: Removing Border from Radio Button

Hi Guys,

In this post I will explain how you can remove border from a radio button prompt.


Here are the steps:

  • Add an HTML Item just before the radio button prompt with below code



<STYLE>
#radio Div.clsCheckBoxList{
border-style:none;
}
</STYLE>
<div id="radio" >

  • Add the second HTML Item next to the radio button prompt with below code.


</div>

          Now you should be able to see the radio button prompt without any border.


    

Cognos: Horizontal Radio Button


Hi Guys,

You might have faced the challenged aligning radio button prompt horizontally as Cognos do not support this behaviour. I found the way to achieve this using Java Script code. Just follow below steps and you should be able to get the radio button aligned horizontally.

  •           Add an HTML Item just before the radio button prompt with below code

  
<STYLE>
#radio Div.clsCheckBoxRow{
display:inline;
whiteSpace:noWrap;
}
</STYLE>
<div id="radio" >
  •        Add the second HTML Item next to the radio button prompt with below code


</div>

  •        Run the report and you should be able to see the radio button aligned horizontally.

     




Monday, 25 May 2015

COGNOS: ADDING TOOLTIP IN A LIST REPORT

Sometimes we may need to add tool-tip for a Column in a List report. Though it is not possible to achieve this using Cognos list properties, we can achieve this using a simple JS script.


Just place two html items before and after the column header

HTML item 1:

<span title='Tool Tip '>

HTML item 2:

</span>

Tuesday, 11 November 2014

COGNOS: CHANGING THE DEFAULT COGNOS PORT

Most of the clients do not want to use the default port number 80 to use due to some security concerns. We can change the port 80 to desire number in Cognos. Here are the steps:

Cognos Configuration :
  1.  Open Cognos configuration.
      2.   Edit gateway URI and Controller URI for gateway , replace port no. 80 with 8081.

Configure the IIS to use port 8081 :
 

1.      On the Windows desktop, click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
 
2.      In Internet Information Services (IIS) Manager, in the Connections pane, expand the computer name, expand Sites, and then click Default Web Site.

       3.      In the Actions pane, under Edit Site, click Bindings.

4.      In the Site Bindings dialog box, click the http entry, and then click Edit.
 
      5.      In the Edit Site Binding dialog box, in Port, type 8081, and then click OK.

7.      In the Site Bindings dialog box, click Close.

8.      In the Actions pane, under Manage Web Site, click Stop, and then click Start.

 

 

 

Thursday, 30 October 2014

Cognos: Auto Refresh Dashboard

Recently I developed a Cognos dashboard which gets refreshed after fixed time interval automatically. This can be achieved easly by using a simple script. Here are the steps:

-Insert a HTML item with below script

    <meta http-equiv="refresh" content="60">

-Select the query and set the "Use Local Cache" property to "No".
-Go to Cognos Connection
-Click report property and set the default action to "Run the Report" under Report tab.
-Run the report. You will see the report get refreshed after each 1 minute interval.

Wednesday, 29 October 2014

Cognos: Ranking using RowNumber() Function

Sometimes we may find hard to use rank function in our report to display Top-N rows. This can be easily solved using RowNumber function. Here are the steps

- Create a prompt with parameter name 'p_rank'
- Create a boolean variable

RowNumber()<=string2int32 (ParamValue('p_rank'))

- select the column on which you want to rank
- Click on Style Variable under Properties window and select the boolean variable
- Click Condition Explorer and select boolean variable value 'No'
- Select Box Type to None
- Run the report

COGNOS: USING OPTIONAL PARAMETER IN A DATA ITEM WITH MACRO

Sometimes we may need to add a data item containing an expression with an optional parameter. In such case if we use simple ?Parameter_name? statement it will ask to enter parameter value at run time. For example, consider the below statement

case when ( ?p1? ='para1')
then
(
'PARA1'
)
else
(
'n/a'
)
end

The above statement will always make the optional parameter to required. To solve the issue we can use macro statement. For example the below statement will keep the optional prompt as optional only even when we are using it within a data item:


case (when #prompt('p1','string',"'dummy'")# ='para1')
then
(
'PARA1'
)
else
(
'n/a'
)
end

COGNOS QUERY STUDIO: CHANGING TITLE IN HEADER BAR


- Open the file (QSRVUITextPL_en.xml) at below location
C:\Program Files\IBM\cognos\c10_64\templates\ps\messages\QSRVUITextPL_en.xml

- Search for 

 <string id="QUERY_STUDIO_WINDOW_TITLE" type="String">

- Give the desired title

e.g., <string id="QUERY_STUDIO_WINDOW_TITLE" type="String">

COGNOS 10.2.1 INSTALLATION ON RHEL 6.4



Install IBM JDK 7.0(64 bits)
1.     Login to Linux server and use below command to start the Java installation
./ibm-java-x86_64-sdk-7.1-1.0.bin
2.     It will get installed at below location
/opt/ibm/java-x86_64-71
3.     Set JAVA_HOME path

Install & Configure Cognos 10.2.1
1.     Go to the location where you have copied Cognos installation files
2.     Unzip installation file using below command
      tar –xvf bi_svr_10.2.1_l86_ml.tar.gz
3.  Run the setup
./issetup
4.  A graphical interface will open. Select the components which you want to install.
5. Cognos will get installed at below location
/opt/ibm/
6. Start Cognos configuration
Ø cd /opt/ibm/cognos/c10_64/bin64/
Ø ./cogconfig.sh
7. Cognos configuration window will open

 8.  Start the Cognos service. If everything got well you can test if Cognos Bi service is working using below link on web browser

Install and Configure HTTP Web Server
I am going to install IBM HTTP Server (32-bit) web server using below steps
1.     tar –xvf ihs.7000.linux.ia32.tar
2.     cd HIS
3.     ./install
4.     After installation we need to add Virtual Directory for Cognos
5.  Add Virtual Directory
6.  Start the server by using below commands
Ø cd /opt/IBM/HTTPServer/bin
Ø ./startIHS.sh
 7.  You can test if web server is working using the link
http://localhost
8.  If everything is going well you should be able to see the Cognos home page
http://localhost:80/ibmcognos


RAVE VISUALIZATIONS IN COGNOS 10.2.1



Rave chart is currently available in Cognos 10.2.1 for Active Reports.  Using this feature the user can create a variety of charts. Using below steps we can enable Visualizations in Cognos:


  •  Open the below IBM link to download the new RAVE visualizations

http://www.analyticszone.com

  •    Select Visualizations under Download link.
  •   Open IBM Cognos Administrator.
  •   Select Visualizations under Library tab.
  •   Select the Import Visualizations button and browse to your downloaded visualization zip file.
  •   Click Import.
  •  Open an Active Report.
 You’ll notice there is a new Toolbox item called Visualization. We can drag and drop that into our page and find that we can now browse our gallery of visualizations from within Report studio.

Tuesday, 16 September 2014

CALLING COGNOS SCHEDULE FROM A COMMAND PROMPT

We can call Cognos schedule from a command prompt by following below steps:

- Open cognos connection -> click on schedule -> select Trigger tab
- Give the trigger Name, e.g. Trigger1
- Open command prompt. Type below command
- Go to trigger directory

<Cognos_dir>\webapps\utilities\trigger>

- Type below command

trigger.bat "http://localhost:9300/p2pd/servlet/dispatch"  sumeet sumeet BASIC Trigger1

-Finish

Monday, 23 June 2014

Cognos: Hiding item/area in a Report for Excel/PDF output

Sometime we may like to hide some section of the report in case of Excel/ PDF output format. This situation mostly occure in case you are using any prompt objects. In such case when we select report output as excel it will leave blank area instead of showing Prompt objects.

We can use  (Don't Print) class to hide any item in a Cognos report. (Don't Print) class will exclude the item from the output. Here are the steps

- Select the layout which you want to hide
- click on Classes property under Properties window
- Select (Don't Print) class under Global Classes list
- Save and run the report

Wednesday, 11 June 2014

COGNOS: INCREASING THE NUMBER OF ROWS IN MS-EXCEL OUTPUT

Cognos allow us to view the report output in different format including MS-Excel 2007.

By default Cognos allow us to display 65000 rows in MS-Excel, but this can be increased

up to 1048576 rows. We can achieve this by doing some changes at Cognos administrator

level. Here are the simple steps

- Open Cognos Administrator
- Select System under Status tab
- Click on BatchReportService. Click on Set Property and set the following variables


RSVP.EXCEL.EXCEL_2007_LARGE_WORKSHEET - true
RSVP.EXCEL.EXCEL_2007_WORKSHEET_MAXIMUM_ROWS - 1048576

- Run the report in MS-Excel format and you will be able to display upto 1048576 records
in a sheet.


Tuesday, 10 June 2014

COGNOS: RESOLVING CAM-CRP-1315 ERROR

You might have faced below error while working on Cognos.

[Cryptography] [ ERROR ] CAM-CRP-1315 Current configuration points to a different Trust Domain than originally configured.


To fix this issue:

- Stop the Copgnos services

- Delete the following folders(please take the backup of the folders):
 
    c10_location/configuration/csk

    c10_location/configuration/encryptkeypair

    c10_location/configuration/signkeypair

- In IBM Cognos Configuration, save the configuration and restart the services.

COGNOS: ALTERNATE ROW COLOR IN A LIST REPORT

Sometime we may like to display alternate color for each row in a list report. This will make our report more redable. I have shared the steps to achieve this in my previos blog. Here is another simple step to achieve the same result.


- Create a Boolean Variable with followin expression
    mod(RowNumber(),2) = 0
- Click on the list for which you want to apply alternate row color.

- Select 'List Columns Body Style' by clicking on Properties Ancentor window.

- Select the newly created boolean variable in Style variable property.

- In Conditional Explorer pane and click on Yes value for the boolean variable. Select the Background color.
- Again click on 'No' value for the boolean variable and select the desired Background color.