Automatic option selection for prompt components “Properties of Select & Search Prompt” PDF Print E-mail


The prompt select and search components have a set of options to perform searches:



To solve the issue mentioned in the title you need to insert in the report a JavaScript code to let it choose by default one of the four options.

Please follow these steps:

1- Select a name for the component such as “search_request” (you can change it but you need to modify the JavaScript code).

2- The component from step 1 must be enclosed by two HTML elements.

The first one contains the code:


The second one contains the code:


/* Select and search options

* 2 - Starts with any of these keywords * DEFAULT

* 3 - Starts with the first keyword and contains all of the remaining keywords

* 4 - Contains any of these keywords

* 5 - Contains all of these keywords



3 - In the line: document.getElementById('search_request').getElementsByTagName('input')[4].click();


you can choose the default option that will be selected by modifying the number between closed brackets.

.cgi file example for Python and Cognos PDF Print E-mail


In this post we show an example of a Store Procedure call and an execution of a Python sentence from Cognos.

The three parameters are read from Cognos components and the AJAX call is done to a file named file.cgi located in CGIlocation.

The following javascript is executed from the Cognos report:

function funcionJS() {

var parameter1 = Number(getFormWarpRequest()._textEditBoxCOMPONENTE_COGNOS1.value); ;

var parameter2 = getFormWarpRequest()._oLstChoicesCOMPONENTE_COGNOS2.value;

var parameter3 = getFormWarpRequest()._oLstChoicesCOMPONENTE_COGNOS3.value;


url: "http://server/CGIlocation/file.cgi",

data: {

parameter1: parameter1,

parameter2: parameter2,

parameter3: parameter3


success:  function(data){

var data = $j.parseJSON(data);

print data.valor;},

error: onError




The .cgi file must contain the following code:


import cx_Oracle,cgitb, cgi, json

print "Status: 200 OK"
print "Content-Type: text/plain;charset=utf-8"

arguments = cgi.FieldStorage()

con = cx_Oracle.connect('user/pass@database')
cur = con.cursor();

par1= cur.var(cx_Oracle.STRING)
# Gets the parameter value parameter1 from the AJAX call

par2= cur.var(cx_Oracle.STRING)
# Gets the parameter value parameter2 from the AJAX call

par3= cur.var(cx_Oracle.STRING)
# Gets the parameter value parameter3 from the AJAX call

cur.execute("call PROCEDURE(:p1, :p2)", p1= par1, p2=par2)
cur.execute("SELECT A,B,C FROM TABLE where column1=:p1 and column2=:p3", p1=par1, p3=par3)

response = {"success": True, "message":"Successfully run", "data": cur.fetchall()}


print json.dumps(response)

TM1 instance won't start PDF Print E-mail
Written by Roger   
Wednesday, 27 July 2016 09:43

Cognos TM1 10.1
Microsoft Windows XP

The TM1 instance does not start – even when it is set to automatic in Windows services.

Error message in windows events:
Event Type: Error
Event Source: tm1sd
Event Category: None
Event ID: 0
Date: 7/27/2016

Time: 10:06:50 AM
User: N/A
The description for Event ID ( 0 ) in Source ( tm1sd ) cannot be found. The local computer may
not have the necessary registry information or message DLL files to display messages from a
remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description;
see Help and Support for details. The following information is part of the event: tm1sd error: 0,
Corrupt "tm1s.log" transaction log file. Server is coming down.

In tm1server log you find:
2728 [] FATAL 2016-07- 27 08:06:50.687 TM1.Transaction
TM1TransactionLog::ProcessTransactionLog: Bad transaction log record, line number 1.
2728 [] FATAL 2016-07- 27 08:06:50.687 TM1.Server Server terminated

In tm1s.log file there is:
"""20160715135733""CubeSerialized: }CubeProperties: by Admin"
#""";20160715135733""CubeSerialized: }DimensionProperties: by Admin"


Erase the tm1s.log file and then start the service.

TM1 java api error PDF Print E-mail
Written by Roger   
Monday, 25 July 2016 11:11


IBM Cognos TM1 10.2.2


Windows 2012 R2 server



When try to run the test script to call a Java code from a TI process outlined here



get an error in the TI process.


Error message:

Prolog procedure line (11):  Errors occurred during execution of process "my.scripts.MyTestTI".  
Check error log file for that process for more details


Check the tm1serverlog file for text like this:


2472  []   INFO   2016-07-25 13:30:30.643   TM1.Process  
[com.ibm.cognos.tm1.jos.extensions.ExtensionManager] - Insert new extension:
C:\Program Files\ibm\cognos\tm1_64\bin64\javaextensions\user\myextension.jar
2472  []   ERROR   2016-07-25 13:30:31.018   TM1.Process  
[com.ibm.cognos.tm1.jos.extensions.JarFileExtensionRecord] -Extension has
invalid extension.xml: C:\Program Files\ibm\cognos\tm1_64\bin64\javaextensions\user\myextension.jar
org.xml.sax.SAXParseException: Premature end of file.
	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
	at com.ibm.cognos.tm1.jos.extensions.ExtensionXml.parseFromXML(ExtensionXml.java:86)
	at com.ibm.cognos.tm1.jos.extensions.JarFileExtensionRecord.load(JarFileExtensionRecord.java:83)
	at com.ibm.cognos.tm1.jos.extensions.ExtensionManager.insertExtension(ExtensionManager.java:96)
	at com.ibm.cognos.tm1.jos.extensions.LocalJarRepository.scan(LocalJarRepository.java:72)
 	at com.ibm.cognos.tm1.jos.extensions.ExtensionManager.addRepository(ExtensionManager.java:51)
	at com.ibm.cognos.tm1.jos.Main.addLocalRepository(Main.java:156)
	at com.ibm.cognos.tm1.jos.Main.main(Main.java:127)


This mean that the jar file is corrupt.

Stop your TM1 application and then from the JAVA IDE recompile the file with ANT.

This is done by save the project after a small change.

Remember to stop the TM1 application service before any change to the jar file.


It is good to only have the jar file in one folder, in the example it should be in folder for your Tm1 application, can be like this:



More information:



CAFE setup SSO and CAM PDF Print E-mail
Written by Roger   
Monday, 25 July 2016 10:45

IBM Cognos TM1 10.2.2
Microsoft Windows 2008 R2 Server

How to setup CAFE to work with SSO and TM1.

Download Cognos CAFE from here

Download the latest Service pack from here

You can install the CAFE fix pack direct on you workstation.

Setup Cognos BI to work with AD login with SSO.

Setup TM1 to work with AD login in the application.

Check to ensure the TM1 cam files are on the BI server;

Logon to the Cognos BI server

Ensure that file <CognosBIInstallDir>\templates\ps\portal\variables_tm1.xml contains the values to point to the TM1 server.

If you have a older version of Cognos BI than of Cognos TM1, then you may need to do this step:

In Windows Explorer, navigate to the following directory: <TM1InstallDir>\webapps\pmpsvc\gateway_files\

Extract the planning_gateway.zip file, and copy the /webcontent/pmhub.html file from within In Windows Explorer, navigate

to the following directory: <CognosBIInstallDir>\webcontent\ and paste the copied pmhub.html file.

Open pmhub.html in notepad and change to the server name to that of the TM1 server.

(For all SSO to work, you need to update the right files on the Cognos BI server to point to your Cognos TM1 server. Check

other instructions to get SSO to work with Cognos TM1)

Setup the values in PMHUB for the CAFE client.

Launch the PMHub via the following URL:


On the left hand side, expand 'com.ibm.ba.pm.resource.security'. Then, click 'com.ibm.ba.pm.resource.security.dictionary' to

open the properties pane.

In the properties pane on the right hand side, configure any of the server related URIs to match your own.

Exit the PMHub

On the Client computer ensure that Microsoft NET framework 4 is installed, this is needed for CAFE client.

Also ensure that Primary Interop assemblies are installed with Office on the workstation.

To install the PIAs when you install Office;

Ensure that you have a version of the .NET Framework that is no older than 2.0.

Install Microsoft Office and make sure that the .NET Programmability Support feature is selected for the applications you

want to extend (this feature is included in the default installation).

Install the CAFE program on the client by running \install\download\cor_win32_10.2.5250.21_ml.tar\win32\issetup.exe

This will install the CAFE program in your Excel installation.

In Microsoft Excel you must allow the plug in, to get it to work.

Run script to update file in folder C:\Users\%username%\AppData\Local\Cognos\Office Connection

The file is CommManagerSettings.xml

Content to change are

<setting name="Servers"><?xml version="1.0" encoding="utf-16"><Servers><Server Dll="Framework.Provider.TM1Rest.dll" 
gateway="http://donaldduck:9510" friendlyname="KALLETM1" /></Servers></setting>
<setting name="EnableSSO">True</setting>
<setting name="CheckFBAC">False</setting>
<setting name="ClearCache">False</setting>
<setting name="RequestTimeout">300</setting>
<setting name="UseGzipCompression">True</setting>


Other files in folder are;





Update below script with your name and the setting for SSO, paste it into NOTEPAD on server and save it as CAFEUPDATE.PS1

$path = "C:\Users\username\AppData\Local\Cognos\OfficeConnection\CommManagerSettings.xml"
(Get-Content $path )| Foreach-Object { $_ -replace "<setting name="EnableSSO">True</setting>", 
"<setting name="EnableSSO">False</setting>" } | Set-Content $path

You cannot edit the SERVERNAME with above script. Get-Content works only on a row at a time. You need to create something that

can search and replace in the whole file.

Here is some help:

http://windowsitpro.com/scripting/replacing-strings- files-using- powershell

You can use any script tool to update the CommManagerSettings.xml

file with your company settings. Use the tool you are familiar with.

Good Luck.

Error message in CAFE when you click Login;

error 404 = wrong value in PMHUB, misspelled server name or use of cognos.cgi

More Information:


More Articles...


CogKnowHow Newsletter

Please register to the site before you can sign for a list.
No account yet? Register