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

Xml link an external stylesheet.css

Started by webgeri, 10 Aug 2016 09:27:14 AM

Previous topic - Next topic

webgeri

Hi

I'm trying to link an external stylesheet.css into a Report.

In the xml I tried to insert this lines, but doesn't work.


<link rel="stylesheet" type="text/css" href="estilos.css"/>


I tried typing that line before/inside the report, layouts, layout, reportPages and page tags.

Which is the code to insert and external stylesheet.css into a Report Design, and where should be placed in the XML?

Thanks, Alejandro

AnalyticsWithJay

You could use an inline style, where you have an HTML item, and inside the HTML item you can add all your CSS code inline, with the <style> tag.

You could also call CSS using an HTML URL like the code you referenced, but you have to add it in an HTML item and place it in your report. I would suggest you try it first with the absolute path before substituting a relative path, to make sure it tests properly.

bdbits

Please do not edit the report XML directly. Therein lies heartache, and the potential for being in an unsupported state should you need IBM support.

Use an HTML item on the report as CognoidJay was saying. Put it as the very first item at the very top of the report. Edit it and insert your code; you have the syntax correct. However, I would note that you have a relative reference, so it is going to look for your stylesheet in the Cognos web folder. That can work, although you might want to put it elsewhere and give an absolute reference to avoid keeping track of this stylesheet when doing upgrades, or multiple copies of it if you have multiple servers. In any case I agree with CognoidJay, try an absolute path first to make sure it is finding the stylesheet.

You can indeed put the styles directly into the Cognos reports. If you are reusing them, this becomes a headache if you want to change something globally. An alternative is to create a report with just the reusable stuff in it, then use those items in your reports as layout component references. This works surprisingly well, and you still only have one place to change styles. And it is all inside Cognos, which tends to make it simpler to maintain.

webgeri

Hi All

Thanks for your answers.
I did it as bdbits says, i put an HTMLitem and inside them a link to the .css I need it.

I used this path

<link rel="stylesheet" type="text/css" href="../schemas/personal-style.css" />

Thanks a lot for your answers.

Cheers, Alejandro