In the past we have introduced a couple of ways to standardize report’s appearances such as designing effective IBM Cognos Report Studio templates and the use of Layout Component References to help centralize and simplify repetitive report design tasks. These techniques mainly focus on changing the look and feel within Report Studio. However sometimes you may find it is difficult to modify the pre-defined report style or there is need to make the changes across all reports. For instance, all your reports will be embedded in your organization’s web application, and one of the requirements is to have all hyperlinks colored in gray and without an underline in order to match the corporate style. In those scenarios, you should consider another approach: globally change report style sheets.

Which files need to be modified?

Similar to most modern web applications, IBM Cognos report styles are mainly defined by four global cascading style sheets. Specifically for IBM Cognos 10, we will modify the GlobalReportStyles_10.css files in the following directory (for windows):

  • c10_location/bin
  • c10_location/webcontent/schemas
  • c10_location/reportstyles /
  • c10_location/webcontent/reportstyles

Note: Make the changes in the GlobalReportStyles_10.css file, NOT the GlobalReportStyles.css as stated in the Administration and Security Guide. The guide introduced below, solely written based on this author’s personal working experience, it is provided “as is”.

Tested Environment

  • IBM Cognos 10.1 on Windows 7
  • IE 8.0

Step by Step Demo Instructions – Globally Changing the Hyperlink Style

  • Log into the IBM Cognos 10 application
  • Launch Report Studio
  • Select the sample Go Sales (query) package
  • Select create a new list report
  • Drag and drop Order method type, Product line, Quantity, Revenue, Gross profit from Sales(query) namespace

  • Group the list by Order method type and Product line
  • Add in total rows for Quantity, Revenue, Gross profit measures (see detailed instructions in Report Studio user guide for adding totals if necessary)
  • Add a required filter

    ..=?ordermethod?

  • Save and name it as “Sales by Order Method – Details”
  • Create another new report using the same Go Sales (query) package
  • Drag and drop Order method type, Quantity, Revenue, Gross profit from the Sales(query) namespace
  • Click on the first column and create a drill through to “Sales by Order Method – Details” report, passing order method code to the child report (please reference to Report Studio user guide on how to create a drill through report in Report Studio if necessary)

  • Run the report and you will notice that by default the drill through link is colored in Blue and Underlined.

  • Over the next in few steps we will change the hyperlink style to dark gray and not underlined.

    Go to your Cognos application server, locate GlobalReportStyles_10.css file in the c10_location/bin folder:

    Note: This can typically be found in the “C:Program Filesibmcognosc10bin” folder in Windows.

  • Create a copy of the GlobalReportStyles_10.css file first. Then Open GlobalReportStyles_10.css file with a text edit such as Notepad.
  • Search “hy /* hyperlink */” section(without quotes), you should see below CSS code:

    hy /* hyperlink */

    {

    color: blue;

    text-decoration: underline;

    cursor: pointer;

    }

  • Change the color value to “#454545”, change the text-decoration attribute to “none”.

    hy /* hyperlink */

    {

    color: #454545;

    text-decoration: none;

    cursor: pointer;

    }

Hint: You can also add/edit other attributes if necessary

  • Save your changes. Repeat step 10 to 17 to make changes for GlobalReportStyles_10.css file in other three folders:

    • c10_location/webcontent/schemas
    • c10_location/reportstyles /
    • c10_location/webcontent/reportstyles
  • Restart IBM Cognos service (Optional but recommended).
  • Re-run the report, notice that the drill through link has been changed to dark gray color (#454545) and non-underlined. When you mouse over any order method type, the hand shape will indicate that it’s a hyperlink/drillable.

Now with the above global change, the report author has the flexibility to style the hyperlink in Report Studio either with or without underline and format it to any web supported color!

3 replies
  1. Jayesh says:

    Hi,

    I have followed the steps mentioned above to change global format. Noe, my reports works fine with HTML output however, when I export it to PDF or any other output format it doesn’t change.

    Can you help me here?

    Regards,
    Jayesh

  2. Susan says:

    you should be able to easily align row/cell within Report Studio instead of javascript. Crosstab is displayed as a table. “ml” is the style class for row(), “mv” is the one for each cell(). Depending on the version of Cognos you are using and the environment you have, the stylesheet may be saved at different locations. I would suggest you to check the Cognos system administration documentation for version specific instruction.

  3. Jo Marie Sellner says:

    I have a question about the crosstab styles:

    I am trying to figure out which styles coorespond to the row crosstab member cell (Crosstabe Node Member property). I have a web site that is displaying several reports and I want create the javascript for centering the row’s member value.

    I have tried the mv and cv and it isn’t working. Any ideas where I can find some futher documenation on how the styles coorspond to a property on the report?

Comments are closed.