COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: andy_mason_84 on 16 Jul 2015 04:24:05 AM

Title: Chart won't inherit Page Body Class
Post by: andy_mason_84 on 16 Jul 2015 04:24:05 AM
Hi All,

So I have a report with multiple charts on.  I want to change the foreground colour on all the charts through a new class created in GlobalReportStyles.css.

I created a new Page Body class with "color: red;" in the settings however when I run the report the text in the charts stays black but if I drag in a new text item that reders red.

When i manually change the Foreground Colour setting on the page body to say green then all the chart text is green.

So why are the charts not inheriting the color in the class but it will if set within the report?

Thanks.

AM

Title: Re: Chart won't inherit Page Body Class
Post by: bdbits on 16 Jul 2015 10:14:11 AM
Use the developer tools in your favorite browser to inspect the CSS for the various objects. My guess is that something is overriding your settings in GlobalReportStyles.css. Something so high-level in the dom like body{ color:red;} is almost certainly getting overridden by something layered on top of the body.

As a side note, I would strongly advise against changing Cognos global css files. Unless there is no other way, changing product files is generally a Bad Idea(tm) and will cause endless headaches down the road, in my opinion. It would be much better to create a component library with an HTML item containing your css that you drop on the reports, or use report templates.