Tuesday, March 6, 2012

Simple steps to change default property of Dates in Cognos 8/10.


Simple steps to change default property of Dates in Cognos 8/10.

The below example can be implemented in Cognos 8.3/8.4 and Cognos 10. By default there is no direct way to change default values of Cognos Date Prompt. However we can use Java Scripts to change the default Cognos prompt behaviour. Below is such an example to document this.

Below example demonstrated using Go Sales (Query) Package

Step 1)

Create a sample new report by adding following fields.

Product line, Product Type, Product and Introduction Date ( all are found in Sales(query) > Products )



Step 2)

Add one prompt page.



Step 3 :

Insert a table with one column and then add one date prompt as below :





Step 4)

Under Date Prompt Properties, name the Date control name as PDate as below (PDate can be replaced by any name you like) :


Step 5 : Insert a HTML item after the Date prompt .


Step 6: Go to HTML item properties and edit the code of HTML as below examples :



JavaScript to Set Default for Date Prompt to Next Day

<script language="javascript">
var dDate = new Date();
//Subtract one day
dDate.setDate(dDate.getDate()-1);
pickerControlPDate.setValue(getFormatDate(dDate, 0 , 'YMD')); 
</script>







Step 7 : Click on OK and run the prompt page.



Below are some more sample java scripts to change default prompt values.



JavaScript to Set Default for Date Prompt to Next Day

<script language="javascript">
var dDate = new Date();
//Subtract one day
dDate.setDate(dDate.getDate()+1);
pickerControlPDate.setValue(getFormatDate(dDate, 0 , 'YMD')); 
</script>

JavaScript to Set Default for Date Prompt to First of Current Year

<script language="javascript">
//Months are 0 to 11
var dDate = new Date();
dDate.setMonth(0);
dDate.setDate(1);
pickerControlPDate.setValue(getFormatDate(dDate, 0 , 'YMD')); 
</script>

JavaScript to Set Default for Date Prompt to Last of Current Year

<script language="javascript">

//Create date to pull next year
var nyDate = new Date();
nyDate.setDate(nyDate.getDate() + 365);

var dDate = new Date('January 1, ' + nyDate.getYear());

//Subtract 1 to get last of current year
dDate.setDate(dDate.getDate()- 1);

pickerControlEndDate.setValue(getFormatDate(dDate, 0 , 'YMD')); 
</script>

JavaScript to default day to first of current month

<script language="javascript">
//Default is today
var dDate = new Date();
dDate.setDate(1);
pickerControlPDate.setValue(getFormatDate(dDate, 0 , 'YMD')); 
</script>

JavaScript to default day to last of current month

<script language="javascript">
var dDate = new Date();
//Get date 1 month later
dDate.setMonth( dDate.getMonth() + 1);
//Switch to first of next month
dDate.setDate(1);
//Subtract 1 to get last of current month
dDate.setDate(dDate.getDate()-1);
pickerControlEndDate.setValue(getFormatDate(dDate, 0 , 'YMD')); 
</script>

JavaScript to default day to first of previous month

<script language="javascript">
//Default date contains current month/year, so set day = 1
var dDate = new Date();
dDate.setDate(1);
//This goes back to last day of previous month
dDate.setDate(dDate.getDate()- 1);
//Now set day = 1 again
dDate.setDate(1)
pickerControlPDate.setValue(getFormatDate(dDate, 0 , 'YMD')); 
</script>

JavaScript to default day to last of previous month

<script language="javascript">
//Default date contains current month/year, so set day = 1
var dDate = new Date();
dDate.setDate(1);
//This goes back to last day of previous month
dDate.setDate(dDate.getDate()- 1);
pickerControlEndDate.setValue(getFormatDate(dDate, 0 , 'YMD')); 
</script>
JavaScript to default day to last year same date

<script>
function subtractYear ()
{
var dtToday = new Date();
var dtLastYearDay = new Date( dtToday - 31536000000 );

// NOTE 3153600000 = 365 Days * 24 hours * 60 (minutes per hour) * 60 (seconds per minute) * 1000 milliseconds per second)
var strLastYearday = [dtLastYearDay.getUTCFullYear(), dtLastYearDay.getMonth()+1, dtLastYearDay.getDate()].join("-");

return strLastYearday;
}
pickerControlPDate.setValue( subtractYear() );
</script>

Wednesday, September 29, 2010

Framework Manager Error while publishing new package

Cognos Error :

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

[ ERROR ] The cryptography information was not generated


Solution : Delete csk,signkeypair and encryptkeypair folders in configuration directory and resave Configuration
Manager.

Interpretation : This can usually happen when you are trying to point from Development environment to Production environment or any other environment by simply changing the configuration in Cognos Configuration Manager.It will prompt informational message as unable to decrpyt userid password.

You will get same error for Transformer too and solution is same.

Friday, June 18, 2010

Configuring Essbase Connection for Cognos 8.4

Steps to Configure Essbase 7.1 in Cognos 8.4 Server

Environment : Cognos 8.4 in Unix Server,Essbase 7.1

Hello Friends, I did not find any good details about it in Cognos documentation,so thought to share with you all so that you do not have to troubleshoot from your side.
Also if you encounter below error,this solution can also help:
Error message : Unable to find or load the shared library 'ld.so.1: BIBusTKServerMain: fatal: /global/site/vendor/cognos/c8_64/./bin/libDB2OlapODP.so: open failed: No such file or directory - /global/site/vendor/cognos/c8_64/./bin/libDB2OlapODP.so' (or one of its dependents) containing the provider 'DB2OlapODP'. Please contact your administrator.

Step1 : Installation of Essbase Client on Cognos Server.
The structure will look like this once you install essbase client in Cognos Unix Server.The installation is pretty easy for Essbase and mostly have to click next.
Servername://Hyperion $ ls -ltr
total 4
drwxr-xr-x 3 common
drwxr-xr-x 9 Essbase


Step 2 : Include the arbor path in Cognos server script.In our case we are using unix so the path will look like as below :

# ESSBASE
export ARBORPATH=//Hyperion/Essbase;

export LD_LIBRARY_PATH=$otherpath:$ARBORPATH/bin:$LD_LIBRARY_PATH;
export PATH=$otherpath:$ARBORPATH/bin:$PATH;


Step 3 : Change the following entries in qseconfig.xml in /configuration directory.
Change following line :
Search for provider name="DB2OlapODP" and in that change
libraryName=doodp82 from existing libraryName=essodp93


By default cognos comes on configured with Essbase 9 so to change to Essbase 7.1 you have to make below changes.

Step 4 : Restart the Services using configuration manager.

Step 5 : Test the connection by creating a Data Source in Cognos connection and pointing it to your Essbase server.Make sure the firewall ports are open between the servers.

Thursday, May 27, 2010

Arithmetic overflow or other arithmetic exception while selecting values from Report Studio query

Issue : User trying to select query from Report studio,by selecting the query item and it displayes below error message

UDA-SQL-0114 The cursor supplied to the operation "APICursor::OpenResult" is inactive.
UDA-SQL-0144 An arithmetic exception was detected.
[IBM][CLI Driver][DB2/6000] SQL0802N Arithmetic overflow or other arithmetic exception occurred. SQLSTATE=22003

UDA-CUR-0000 Unable to fetch the row.


Anaysis :

When checked in detail the query item was a numeric value with a large no of rows in database.
The column is integer and the rollup is defined as Automatic and Aggregation function is defined as Total.

In the expression editor, when searching for values for a data item, the results you obtain may contain unexpected results if the data item is not a string data type. Because users can edit the expression for a data item, IBM Cognos 8 cannot determine with certainty what the data type is.

Therefore, IBM Cognos 8 guesses the data type of the data item by looking at its aggregate and rollup aggregate set

Try to change the Aggregation function and Roll up aggregation to Not Applicable and then try searching the values.

The Things you can try is changing the attribute from Framework manager itself.

Note : The below observations are just based on my analysis incase you find some other reasons and solutions for its,please let me also know.

Friday, February 19, 2010

Modeler Role setting for Cognos 8 incase you do not want to give Server Admin rights

Problem : Got new transformer licenses,but need to setup Modeler role in Cognos 8 configuration.Do not want to give System Administrator roles to
modelers and want to restrict access only what they will require.

Error Messages :

TR0164 Data source create problem. CCL-RCI-0002 The Soap server returned a Soap fault.

CM-REQ-4012 you do not have the appropriate permissions to update or delete the object "/Directory/Cognos" or a related object


Solution : Some of the points are from Cognos documentatin,however it is not more specific there in document.


1) Database client software is installed, or available for modelers to install, on the Transformer computers that are used to access IBM Cognos 8 data sources.

2) Modelers must have privileges to create a data source in IBM Cognos Administration.

The good way to do it is create a role as Cognos modeler in Cognos group and assign the roles required as below to it.The individual modeller ids can be
added to group then.

Go to IBM Cognos Configuration.

To enable capabilites select the Administrator Set Properties tab.Add the Modeler group you created and assign just traverse permission here.

Click on Administration and select Set Properties for Data Source Connections.Add the Modeler group and assign read,write,execute and traverse permission here.

Go back to main Capabilites page and select Set Properties for Cognos Viewer.Add the Modeler group and assign execute and traverse permission here.


3) Modelers must have access to a location in which to store the PowerCube after building it.

4) To build PowerCubes on a specific Transformer server, modelers should have FTP privileges to transfer models and execute privileges to build cubes on that server.
Normally its good idea to restrict access as far as possible in server.

Wednesday, February 17, 2010

Error while opening Framework Manager Data Source Connections

Error:

QE-DEF-0368 Unable to decrypt user name and password from the Content Store. Use Cognos Configuration to configure your reporting environment.

Environment : FM in Windows and Cognos 8 BI server in Solaris 9.

Solution :
Close Framework Manager and Cognos Configuration from machine.From the \crn\configuration folder on the Framework Manager installation, rename / deleted these directories:

1) csk
2) signkeypair
3) encryptkeypair

Open configuration manager and save the configuration.Launch Framework Manager and and it should be work fine.

Monday, November 9, 2009

HTTP 403 Error with Siteminder and Apache in Cognos 8.4

If you are having siteminder configuration in your environment and if you are getting below error message :

You are not authorized to view this page

You might not have permission to view this directory or page using the credentials you supplied.
If you believe you should be able to view this directory or page, please try to contact the Web site by using any e-mail address or phone number that may be listed on the Website.url home page.
You can click Search to look for information on the Internet.

HTTP Error 403 - Forbidden Internet Explorer

Symptoms : Some of the Cognos 8.4 features when clicked giving HTTP 403 error like
1) when clicking on Folders inside Cognos default security namespace
2) when clicking on Datasources to view signon connection.

Solution : Go to Cognos Configuration and enable following settings :

Local Configuration > Security > IBM Cognos Application Firewall

Enable CAF Validation : True ( By Default)
Is third party XSS checking enabled : True

If the page is still giving HTTP 403 error,go to siteminder logs and see if its giving Invalid Characters error.If so,check for the naming convention of folders/datasource and correct it.Also it can be corrected from Siteminder side if those naming conventions are absolutely necessary.