Topic
  • 2 replies
  • Latest Post - ‏2013-07-15T23:44:50Z by Gicy
Gicy
Gicy
2 Posts

Pinned topic Using external CSS style sheet in Cognos doesn't work for PDF output

‏2013-07-11T00:41:36Z |

Hi,

I am trying to see how feasible it is to use external css file to apply styles in report studio. The reason I am not trying to customize GlobalReportStyles_10.css  is because of the upgrade impact and you also need to keep several copies of this css file in sync. So, if I could use my own css file located in a folder, let's say, ../mycss/mystyle.css

In Report studio, I can have an HTML tag that will refer this mystyle.css as show below:

<link type="text/css" href="
../mycss/mystyle.css" rel="Stylesheet" />

It works for HTML output but when I run for PDF/Excel output, the default Cognos CSS styles are applied. I even tried putting mystyle.css file under ../bin directory and restarting both web serer and Cognos server.

Has any of you been able to use external css files in Report Studio sucessfully for all html, pdf and excel report output?

Any help will be will appreciated.

Thanks.

  • rperzul
    rperzul
    25 Posts

    Re: Using external CSS style sheet in Cognos doesn't work for PDF output

    ‏2013-07-12T13:54:10Z  

    Hi,

    unfortunately I am pretty sure that when you run a report in any format other than HTML an HTML item in the report will not be executed at all. Have you tried putting a link or reference to your custom CSS file in GlobalReportStyles_10.css?

    Regards,

    Ron

  • Gicy
    Gicy
    2 Posts

    Re: Using external CSS style sheet in Cognos doesn't work for PDF output

    ‏2013-07-15T23:44:50Z  
    • rperzul
    • ‏2013-07-12T13:54:10Z

    Hi,

    unfortunately I am pretty sure that when you run a report in any format other than HTML an HTML item in the report will not be executed at all. Have you tried putting a link or reference to your custom CSS file in GlobalReportStyles_10.css?

    Regards,

    Ron

    Thanks Ron.

     

    Yep, I tried referencing external css within the GlobalReportStyles_10.css as shown below:

    @import url(<path to custom.css>) print;
    

    OR

    @import url(<path to custom.css>);
    

    Unfortunately, Cognos report server seems to be not able to read external CSS file for PDF/Excel output.