Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Stiles from external css files do not work
kakatoo
Hi.
I am using Birt 2.5.1 and I have some reports built. I have a very frustrating expirience. I have some css files that define some styles for my reports. If I just link to those css files in my report designer I see the desired effect on the elements when I assign a certain style that is defined in my css file on them. However, when I run the report the styles from my external css files are ignored. The only workaround I found is to import my css files into report and then I can successfully use the styles that have been converted into internal xml BIRT format. But this is poor workaround and is not good enough for my client. One of the reasons that they have chosen BIRT over Jasper is it's support for css files. Strangely I did not find any reference to this problem anywhere on the net. Any ideas?
Thank you in advance.
Find more posts tagged with
Comments
Virgil Dodson
Hi kakatoo,
When you Use a CSS file in BIRT, you have the option to specify a run-time, and view-time (HTML-only) location of the CSS file. I've not been able to replicate a problem where the CSS file does not get used at all, but since you said you can see the CSS file getting references when you link to it, but not when you run, you should make sure you have not put a bogus value in the view-time location of the CSS file... see screenshot?
If you can't get this working, post a sample of the offending CSS file so I can test it.
kakatoo
Thanks. I did see this option that you described and I did not mark it to be included for view time. So this is not appears so be a problem. I am attaching my CSS file. Note that the styles there are not predefined, so you will need to assign a style manually to a report component. In my case the styles are made for tables, rows and cells. You can see it by the names of the styles. Like I said, I can see it working in report designer, but not at runtime as long as I do not import the styles into my report.
Thanks,
Michael Gantman
kakatoo
Here is css file that I forgot to attach
Virgil Dodson
These styles are working for me in both Designer and Runtime (using the BIRT Viewer) Are you using the Viewer, or runtime APIs?<br />
<br />
I'm using BIRT 2.5.1 and have my report design in a folder called 'formatting'. I also copied the CSS file to the same folder just to keep them close. On my design, I select 'Use CSS' on the Styles icon in the Report Outline and point at the CSS file.<br />
<br />
I assigned two different styles to a group header and detail row. In the designer, I can see grey header colors and red details rows. Since this appears to be working correctly, I will move on to the Viewer.<br />
<br />
I copied my report design to the root of the BIRT Viewer application also into a folder called 'formatting' I did this because I noticed the CSS file in the BIRT XML Source would be looked for at formatting/AlunaStyles.css. Set a View-time location if you want it somewhere else.<br />
<br />
I then ran my report using the URL below.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>http://localhost:8080/birt251/frameset?__report=formatting/styles_external.rptdesign</pre>
<br />
The styles worked as expected.<br />
<br />
Can you try some steps like I've done above?