If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Global Report Styles

Started by blom0344, 16 Mar 2011 05:42:08 AM

Previous topic - Next topic

blom0344

According to IBM changing the GlobalReportStyles.css should still be a way to work with additional .css classes. I have added our own set of classes to the 4 occurences of GlobalReportStyles.css, but they do not show up in Report Studio (which always worked for me in 8.x versions) Changing existing classes in the .css does not seem to have any impact either..

http://publib.boulder.ibm.com/infocenter/cfpm/v10r1m0/index.jsp?topic=/com.ibm.swg.im.cognos.ug_cra.10.1.0.doc/ug_cra_id34923style_sheet.html

What am I missing?

blom0344

Well, this was one was easy  :)  The documentation mentions GlobalReportStyles.css, but Cognos 10 RS opens up by default with 10.x styling.
To use new global classes in both  8.x / 10.x styling, then modify both GlobalReportStyles.css and GlobalReportStyles_10.css files. 

bdbits

Just a thought, if you want to keep custom css separate, you can create a css file on a web server (could be your cognos server). Then add a simple HTML item to the top of the reports.

<link href="http://host.example.com/css/reports.css" type="text/css" rel="stylesheet" media="screen,print">

You need to change the example href, of course. In my experience this gets loaded as the last css file so you can put in CSS to override Cognos defaults from the myriad of default stylesheets.

Actually, I put the HTML item in a report that acts as a 'library' of components and use a layout reference so if I have to change it, there is just one spot to do it. But that is a little outside the scope of this topic. :)

Ryan Snead

Quote from: bdbits on 23 Mar 2011 09:42:40 AM
Just a thought, if you want to keep custom css separate, you can create a css file on a web server (could be your cognos server). Then add a simple HTML item to the top of the reports.

<link href="http://host.example.com/css/reports.css" type="text/css" rel="stylesheet" media="screen,print">

You need to change the example href, of course. In my experience this gets loaded as the last css file so you can put in CSS to override Cognos defaults from the myriad of default stylesheets.

Actually, I put the HTML item in a report that acts as a 'library' of components and use a layout reference so if I have to change it, there is just one spot to do it. But that is a little outside the scope of this topic. :)

I tried this in Cognos 10.1.1 to modify some List header row background elements. It worked for HTML output, but not for PDF output.  ??? Does this have something to do with the link element not being rendered for the PDF?

sir_jeroen

#4
Ryan you're right.. It only gets rendered in HTML.
You could try this... (I haven't tried it, so share the result)
Add to each of the stylesheets (i believe 4 GlobalReportStyles.css and 4 GlobalReportStyles_10.css) the following:
@import url(your.css);
It's the same technique used by cognos for the skins (take a look at the file <c10 install>\webcontent\skins\contemporary\portal\default.css
Cognos uses the same technique...

Ryan Snead

Yes. I can verify that this works for HTML and PDF.

I had some trouble getting the CSS overlay precedence to work correctly, so I ended up commenting out the styles I was replacing. Given our project timelines, I had to settle for the  good enough solution. However, I see no reason the precedences could not be resolved with a little more effort.

Good thread. Thanks all!

Quote from: ReportNet Addict on 11 Jun 2012 01:46:14 PM
Ryan you're right.. It only gets rendered in HTML.
You could try this... (I haven't tried it, so share the result)
Add to each of the stylesheets (i believe 4 GlobalReportStyles.css and 4 GlobalReportStyles_10.css) the following:
@import url(your.css);
It's the same technique used by cognos for the skins (take a look at the file <c10 install>\webcontent\skins\contemporary\portal\default.css
Cognos uses the same technique...

sir_jeroen

Thanks for mentioning this...