Cognos Feeds
|
Knowledge Articles
|
CogKnowHow.com - The IBM Cognos Knowledge Base | Links Documentation Forum Community Tips and Tricks
|
-
How to use JavaScript to add Google Maps to Cognos reports
This technique uses JavaScript against underlying report objects and methods in a IBM Cognos 8 BI report. For this reason, there is no guarantee that reports created using this technique will migrate or upgrade successfully to future versions without requiring modifications. Any such modifications are the responsibility of the report designer.
Description: This sample shows how to add Google Maps to Cognos reports.
Solution for Cognos 8.4: This sample displays a report containing branch addresses and a column containing a hyper-link "Show Map". When the hyper-link is clicked, the map will be displayed in the left panel. The hyper-link is implemented as a HTML item with the "Source type" as Report Expression, containing:
'<a href="http://www.cogknowhow.com/#" onClick="displayMap( '''+ [Query1].[Address 2] +', '+[Query1].[City] +', '+[Query1].[Country]+''')"> Show Map</a>
The map contains also a red marker, a balloon displaying the selected address and controls to manipulate the map. The script uses the Google Maps API available here:
1. Create a new data item Address 2 with the following expression (this is a SQL Server function, the second argument is 4 quotes: replace([Sales (query)].[Branch].[Address 1],'''','\''') 2. Associate the page to Address 2, because, it is not displayed in the layout. 3. Modify the HTML ITEM to use Address 2.
*************************************************** SDK sample Description: The SDK Java sample will connect to a Microsoft SQL Server database, extract the records from a specified table, create new contact objects and import the values in the name and email columns into the new objects in the Cognos Content Store. The script can be changed to include additional columns if required. Steps - 1. Unzip the attached java file.
2. Change the following values appropriately String theServer = "localhost:1435"; //db server and port String theDatabase = "gosales"; //database name String theTable = "Contacts"; //table name with the contacts String theUser = "sa"; //DB userID String thePassword = "sa"; //DB password String endPoint = "http://localhost:9300/p2pd/servlet/dispatch"; //URL to ReportNet String namespaceID = "DLDAP"; //CRN namespaceID String userID = "admin"; //CRN userID - has to have Sys Admin permissions String password = "password"; //CRN user password String selectClause = "SELECT FROM " + theTable; //Colums to be selected from the DB 3. Compile and execute the script according to the Cognos Software Development Kit Getting Started Guide
/* * - How to copy contacts names and emails from MSSQL DB into Content Store. * * Description: The sample will connect to a Microsoft SQL Server 2005 database, extract name and email * records from table theTable and import the values in name and email columns into Cognos8 Content Store. * Note: This sample uses the Microsoft JDBC driver 2005. To download this driver consult Microsoft site. * The code can be edited to include additional columns if required. */
import java.rmi.RemoteException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import com.cognos.developer.schemas.bibus._3.*;
public class ImportContactsFromDB { //Store contacts names and emails protected Map<String, String> nameEmailMap = new HashMap<String, String>();
private ContentManagerService_ServiceLocator cmServiceLocator = null; private ContentManagerService_Port cmService = null;
public ImportContactsFromDB() { try { // Load the Microsoft SQLServer JDBC Driver. Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); } catch (Exception e) { e.printStackTrace(); } }
//construct the connection string to the database. public String getConnectionString(String theServer, String theDatabase) {
String connectionString = "jdbc:sqlserver://" + theServer +";databaseName=" + theDatabase; return connectionString; }
//Test connection public void checkDbConnection(String theConnectionString) throws SQLException { try { Connection connection = DriverManager.getConnection(theConnectionString); } catch (SQLException e) { if (e.getErrorCode() == 0) { throw e; } } }
//get connection with valid id, password. public Connection getConnection(String theConnectionString, String theUsername, String thePassword) throws SQLException { return DriverManager.getConnection(theConnectionString, theUsername, thePassword); }
//query the database with the select statement. public void query(Connection theConnection, String theSqlQuery) throws SQLException { Statement stmt = theConnection.createStatement(); ResultSet result = stmt.executeQuery(theSqlQuery);
while (result.next()) { String name = null; String email = null; name = result.getString("first_name").trim() + " " + result.getString("last_name").trim();
if (result.getString("EMAIL") != null) { email = result.getString("EMAIL").trim(); }
//add names and their corresponding emails in the map if (name != null && email != null) { nameEmailMap.put(name, email);
}
System.out.println(name + "\t" + email); }
}
//add contacts in Cognos namespace. public void addContactsToCRN() { BaseClass bc[] = new BaseClass[nameEmailMap.size()];
Iterator nameEmailItr = nameEmailMap.entrySet().iterator(); int i = 0; while (nameEmailItr.hasNext()) { Map.Entry nameEmail = (Map.Entry) nameEmailItr.next();
Contact contacts = new Contact(); TokenProp tp = new TokenProp(); tp.setValue(nameEmail.getKey().toString());
StringProp spe = new StringProp(); spe.setValue(nameEmail.getValue().toString());
BaseClassArrayProp bcap = new BaseClassArrayProp(); BaseClass bcc[] = new BaseClass[1]; Nil nil = new Nil(); StringProp sp = new StringProp();
sp.setValue("CAMID(\":\")"); nil.setSearchPath(sp); bcc[0] = nil; bcap.setValue(bcc);
contacts.setDefaultName(tp); contacts.setParent(bcap); contacts.setEmail(spe);
bc[i] = contacts; i++; }
this.addObjectsToCRN(bc); }
//add contact objects in content store. public void addObjectsToCRN(BaseClass[] objects) { AddOptions ao = new AddOptions(); ao.setUpdateAction(UpdateActionEnum.replace); //replace if already exists
SearchPathSingleObject singleObject = new SearchPathSingleObject(); singleObject.setValue("/directory/namespace[@name='Cognos']"); try { // add the new contacts to the content store BaseClass bc[] = cmService.add(singleObject,objects,ao); System.out.println("The contacts from the DB were added to the CS."); } catch (RemoteException e) { e.printStackTrace(); } }
public void connectToCRN(String sendPoint, String namespaceID, String userID, String pass) { //Connect to ReportNet String endPoint = sendPoint; try { cmServiceLocator = new ContentManagerService_ServiceLocator(); cmService = cmServiceLocator.getcontentManagerService(new java.net.URL(endPoint));
if (namespaceID != null && userID != null && pass != null) this.quickLogon(namespaceID, userID, pass); } catch (Exception e) { System.out.println(e); } }
public String quickLogon(String namespace, String uid, String pwd) { StringBuffer credentialXML = new StringBuffer();
credentialXML.append("<credential>"); credentialXML.append("<namespace>").append(namespace).append("</namespace>"); credentialXML.append("<username>").append(uid).append("</username>"); credentialXML.append("<password>").append(pwd).append("</password>"); credentialXML.append("</credential>");
String encodedCredentials = credentialXML.toString(); XmlEncodedXML xmlCredentials = new XmlEncodedXML(); xmlCredentials.setValue(encodedCredentials);
//Invoke the ContentManager service logon() method passing the credential string //You will pass an empty string in the second argument. Optionally, //you could pass the Role as an argument but for the purpose of this //workshop don’t be concerned with Roles.
try { cmService.logon(xmlCredentials,null ); } catch (Exception e) { System.out.println(e); } return ("Logon successful as " + uid); }
public static void main(String args[]) { String theServer = "localhost:1433"; //db server and port String theDatabase = "gort"; //database name String theTable = "Contact"; //table name with the contacts String theUser = "sa"; //DB userID String thePassword = "sa"; //DB password String endPoint = "http://localhost:9300/p2pd/servlet/dispatch"; //URL to ReportNet String namespaceID = "LDAP"; //CRN namespaceID String userID = "admin"; //CRN userID - has to have Sys Admin permissions String password = "password"; //CRN user password String selectStatement = "SELECT first_name, last_name, email FROM " + theTable; //Colums to be selected from the DB
ImportContactsFromDB driver = new ImportContactsFromDB(); String connString = driver.getConnectionString(theServer, theDatabase);
try { Connection conn = driver.getConnection(connString, theUser, thePassword); driver.query(conn, selectStatement); driver.connectToCRN(endPoint, namespaceID, userID, password); driver.addContactsToCRN(); } catch (SQLException e) { e.printStackTrace(); } } }
************************************************
-
ccl-bit-0006 the http message is unexpectedly short
Product: Cognos BI 10.1.1 Cognos TM1 9.5.2 Windows 2008 R2 Server
Symptom: Some Cognos BI reports have stopped to work. They worked fine last month. They give strange error about WebSphere, but this a Windows installation with default Cognos BI built-in tomcat engine.
Error Message: ccl-bit-0006 the http message is unexpectedly short The connection closed before the request is processed. If you are using WebSphere Application Server, to reduce the frequency of this error, increase the Persistent Timeout parameter for the Web container transport chains in the administrative console. Increase the time in 10-15 second intervals until the error no longer or rarely occurs
Cause: The error message is because the report process timeouts, but this can be of different issues. In this case it is the TM1 application who disconnect the reports users process direct at start of the report.
If you time with a stop watch from you press RUN in the report after the prompt page, until the error message. If that is exactly 60 seconds, then it is Cognos BI that have time out.
You need to investigate further to find why the report does not work.
If the report is getting data from a TM1 cube, run the TM1TOP utility to that cube and monitor what happens when the report is run.
If you want to change the timeout value in Cognos BI - do this: 1. Navigate to the <IBMCOGNOS home>/tomcat/conf directory 2. Open server.xml 3. Locate the following entry: <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="9300" minProcessors="5" maxProcessors="75" enableLookups="true" redirectPort="9443" acceptCount="100" debug="0" connectionTimeout="60000" useURIValidationHack="false" disableUploadTimeout="true"/> <!-- Note : To disable connection timeouts, set connectionTimeout value to -1 --> --or-- <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="9300" protocol="HTTP/1.1" maxThreads="500" enableLookups="true" redirectPort="9443" acceptCount="500" debug="0" connectionTimeout="60000" disableUploadTimeout="true" maxHttpHeaderSize="16384"/> ----------------------------- 4. Change the connectionTimeout value from 60000 to xxxxxx (in milliseconds) 5. Save server.xml 6. Restart Cognos BI service If the TM1 cube is feed with data from Cognos Controller, any change to dimensions/accounts will be transferred over to the TM1 cube. If a report is built with the dimension name in Cognos Report Studio - that report will not know of the change of dimensions name, and stop working.
When the Cognos BI report ask for a field that does not exist, the TM1 Application disconnects the connection. And the Cognos BI Report will timeout.
Solution: Run the report for different months - does it work for older months? Make a copy of the Cognos BI report. Remove parts of the Cognos BI report and run it again. Repeat above until you find the part that is making the report not to work. Check that value in the TM1 cube. Have it changed since last month ?
Rebuild the report to contain correct fields/dimensions names.
www.cogknowhow.com
-
DPR-ERR-2088 The requested Server Group '' does not exist
Product: Cognos BI 10.1.1 Windows 2008 R2
Symptom: When you go to the administration dialog in Cognos Connection you get a error message. DPR-ERR-2088 The requested Server Group '<name>' does not exist
Possible Cause: One of the BI servers in the server group does not have all correct service set to true. Check that the following IBM Cognos service are active: Delivery service enabled Event Management enabled Presentation service enabled
Solution: 1.Open Cognos configuration on the Cognos BI server 2.Check the Cognos service - component properties 3.Set all component properties to true. 4.Save the configuration 5.Start the service 6.Surf to Cognos connection 7.Remove the server group name from the BI dispatchers
www.cogknowhow.com
-
How to move the Business Insight Advanced Insertable Objects pane to the left side
Problem How can the Insert-able Objects pane in Business Insight Advanced (BIA) be moved from the right side to the left side of the work area screen?
Solution To use the defaults from version 8.4, configure Business Insight Advanced to behave like the Report Studio Express authoring mode using menu item Tools, and Options.
1. Click on Tools > Options > View tab 2. Modify the checkbox for "Position pane on the right (requires restart)"
This setting controls the position of the Insert-able Objects pane and Properties pane, displaying it to the right or left of the work area. This check box is selected by default. For the change to take effect, close and then restart Business Insight Advanced.
www.cogknowhow.com
-
Why do i not see the trickle of data in the FAP log dialog
Product: Cognos Controller 10.1 FAP
Problem: I do not see the trickle of data in the FAP log dialog.
Solution: Correct log level, not set at startup of FAP process. When you setup the Controller FAP process, you must active HIGH logging level to allow the trickling steps to be written to log table.
1.Go into Cognos Controller FAP Manager. 2.Edit the source (the controller database) you are using 3.Set the Log Level to 'High' 4. Click Save.
Edit the data mart (the tm1 connection) you are using. Set the Log Level to High. Click Save.
You need to stop the Data marts and you need to stop the Source Then you need to start the Source and start the Data mart again to active your change in logging. (this will make a intial publish - who may take long time) Then you will see a line like; -Start trickling data -Finished trickling data.
Then you should be able to see when the trickling is done.
www.cogknowhow.com
-
How to find the Cognos uninstall log file
Problem
The Installation and Configuration guide indicates that a file is created at the time of uninstall which tracks the components and files removed by the operation. Where is this directory and file located? A explorer search will not return any results for "cognos_uninst_log.htm"
Solution
There are a few causes of no search results: The file extension created by the uninstall process is TXT, rather than HTM. Specifying the extension as HTM will cause no results to be returned. Windows search may not review folders beyond a certain depth, so the TEMP folder location may not be covered in a search.
Find the uninstall log in the TEMP folder location by reviewing the computer properties: 1. Right click on "My Computer" and select properties 2. Click on the "Advanced" tab 3. Click on the "Environment Variables" button 4. Review the TEMP location that is generated by the operating system for your login 5. Navigate to this folder and look for cognos_uninst_log.txt
www.cogknowhow.com
-
Controller : PDF report does not show, user see a progress bar instead
Product: Cognos Controller 10.1 Adobe Reader 10
Symptom: When Cognos Controller user run a standard report, and it show fine in HTML. Then user change to view it in Adobe Reader PDF format, then they only get a progress bar and the PDF does not show.
Problem: PDF report does not show - user see a progress bar instead.
Cause: Adobe Reader 10 is not supported by Cognos Controller 10.1 More information here http://www-01.ibm.com/support/docview.wss?uid=swg27020782#eft
Solution: Start Adobe Reader X on the client computer and under menu edit - preferences select general dialog uncheck "Enable Protected Mode at startup" click OK Then start Cognos Controller Client, and test a standard report again.
This change is saved per user on the client, so the best is if the IT department can roll out this change of Adobe Reader with a GPO.
www.cogknowhow.com
-
Controller : FAP service can not login to the TM1 application
Product: Cognos Controller 8.5.1532 FAP Windows 2008 Cognos TM1 9.5.2
Symptom: During IP for Controller FAP you get a error message that the FAP service can not login to the TM1 application. When you change client id and restart the FAP service, you get not error message, the FAP service is only hanging. If you reboot the physical server, the FAP service will try to login once, and then fail. There are no "fatalerror.log" in the FAP service folder on the server.
Background: You have changed to use CAM ID and SSO to access Cognos Controller. The servers and the users are in different Windows domains with trust between.
Error message: Severity: CRITICAL Description: Could not login to TM1, host: SERVERNAME, server name: TM1 SERVER NAME, user name: admin
If you hold the mouse over the error message in FAP manager, you see the text: SystemServerNotFound
Cause: The windows account that run the IBM Cognos Controller FAP server must be a domain account in the same domain that the Cognos BI server authenticate against. You must be able to surf to http://servername/cognos8 from the server logged in as the service account, and SSO should work.
Solution: Create a new windows service account in the domain that contains the users Make that new windows service account local admin on the FAP server Change the windows account that start the FAP service, to use the new service account.
You may need to enter the account with domain\name in the field for name to the FAP service to make it possible for the FAP service to use the account.
Start FAP service again and test if the FAP publish works now.
In FAP Manager for the connection edit, ensure you enter the client name and domain in same capital letters as used for the namespace id in cognos configuration. If the namespace ID is AD then you need to enter AD\username in the FAP manager for the TM1 connection.
www.cogknowhow.com
-
Clicking on "update application" in TM1 contributor results in an error
Product: Cognos TM1 9.5.2 Windows 2008 R2 server
Symptom: When you are inside TM1 Contributor web site and click on "update application" icon you get a error message. You can start the TM1 application, it is only the Admin dialog that does not work.
Error message: Connecting to server application error Could not open specified application
Cause: The TM1 application have not been successfully installed to the new TM1 contributor server
Solution: You need to do this steps if you want to move a complete TM1 application between servers.
How to export a TM1 contributor application from PROD server:
Open the TM1 Contributor Portal. 1. Mark the application to export. 2. Click Export button. 3. Click Save on the File Download dialog box. 4. Navigate to the directory where you want to save the export file. 5. Click Save. This create a zip file of your TM1 Contributor application.
Go into TM1 Architect and open you TM1 application - select SAVEALL. Exit TM1 Architect. Stop the TM1 windows service.
Zip the datafolder for your TM1 application on the PROD server.
Copy the ZIP files over to the other TM1 server.
How to import a TM1 contributor application to DEV server:
We assume you already have a TM1 application here, that you only want to update with data from the other TM1 server.
If you allready have a application in the TM1 Contributor application with the same name, you need to delete it first as Administrator in the TM1 Contributor Portal on the DEV server.
Stop the TM1 windows service. Unzip the datafolder files to the TM1 application folder on the DEV server. Make any changes needed to tm1s.cfg file ( e.g. change server name) Start the TM1 windows service.
1. Open TM1 server from architect. 2. Run the following TM1 control TI Process: “}tp_admin_delete_all” 3. Click OK on Provide Parameters Values dialog. 4. Exit TM1 Architect program.
Import the TM1 Contributor application as an Administrator in the TM1 Contributor Portal
Steps: 1. Open the TM1 Contributor Portal. 2. Click import button. 3. The Application Import window opens. 4. Select the TM1 Server onto which you want to import the application. 5. Click Browse next to the Application file field. 6. Navigate to the application (.zip) file, then click Open. 7. Select the Import application security option if you want to import security settings with the application. 8. Select the Import application properties option if you want to import property settings with the application. 9. Click Import.
Now you should be able to click on the UPDATE APPLICATION icon.
Any status indicators of the TM1 contributor nodes can be lost during the process.
-
User have to login to TM1 again after they have been away from the computer
Product: Cognos TM1 9.5.2 Microsoft Windows 2008 R2 server
Symptom: User have to login to TM1 again after they have been away from the computer
Cause: Unexpected timeouts may occur when the Default Parameter is changed or when the precedence of settings results in unexpected behavior. The setting in the web.config file takes precedence over idle timeout in IIS and machine.config. When timeout is missing in web.config then the setting from machine.config takes precedence.
For best results, do not change the default settings. To prevent a TM1Web session from timing out, if you do change the default setting, take into account your business requirements and the precedence of timeout settings.
To diagnose a timeout problem, be sure a setting has been made in the tm1s.cfg. No timeout setting means you never time out.
IdleConnectionTimeOut Seconds specifies a timeout limit for idle client connections in seconds. For example, if you include the line IdleConnectionTimeOutSeconds=900 in tm1s.cfg, the server disconnects idle client connections after 900 seconds.
Solution:
Increase the different time out values in the Cognos solution to two hours;
1) Go to the folder for you TM1 application Open tm1s.cfg in notepad Increase timeout IdleConnectionTimeOutSeconds (tm1s.cfg) from 900 sec to 7200 sec (= 120 min). Save the tm1s.cfg file. Restart the TM1 application service from inside TM1 Architect. (if the TM1 cube is to be used with Controller FAP recommendion to increase the value to IdleConnectionTimeOutSeconds=36000)
2) Start Internet Information Service (IIS) manager and click on default web site. On the right side click on Limits to open "Edit Web Site Limits" dialog. Enter 7200 as value for "Connection timeout ( in seconds )" Click OK
3) Click on Application Pools Click on the application pool used by cognos (cgi-bin) and the DefaultAppPool On the right side click on Advance Settings Change Idle-time out (in minutes) from 20 to 120. Click OK
4) Edit Web.config in the c:\inetpub\wwwroot\TM1Web folder.
Locate the following code:
<!-- SESSION STATE SETTINGS By default ASP.NET uses cookies to identify which requests belong to a particular session. If cookies are not available, a session can be tracked by adding a session identifier to the URL. To disable cookies, set sessionState cookieless="true". --> <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes cookieless="false" timeout="120" />
Change the timeout value (in minutes) from 20 to 120. Save Web.config.
5) Open web.config and find executionTimeout <system.web> <!-- asp.net request execution timeout, compilation debug must be set to false --> <httpRuntime executionTimeout="110" /> change the value to "7200" instead of "110" seconds. Save Web.config
6) Increase timeout of IIS worker process from sec (=20 min) to 7200 sec (= 120 min) with:
cscript %SystemDrive%\Inetpub\AdminScripts\adsutil.vbs set W3SVC/AppPools/ApplicationPoolName n
7) Inside Internet information service (IIS) manager Click on the ibmcognos folder (or tm1web folder) Double-click on CGI to configure CGI time-out settings Change behavior time-out (hh.mm.ss) from 00:15:00 to 02:00:00 Click on Apply
Restart IIS after changing timeout settings
www.cogknowhow.com
|
|
|
|