Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to use STYLE in HTML element? It not work(I try to make dropdown menu using CSS, but CSS not work.)
How to use STYLE in HTML element? It not work [message #1244410] Wed, 12 February 2014 09:41 Go to next message
Martin Simon is currently offline Martin SimonFriend
Messages: 4
Registered: February 2014
Junior Member
I try to make dropdown menu using CSS, but CSS not work, it seems that is ignored. I try this simple example, but again, styling is ignored. How to include my CSS Style definition into HTML element in BIRT? Are these STYLE tags ignored? This example is from http://www.eclipse.org/birt/phoenix/ref/ROM_Text_SPEC.pdf, but not work.

<HTML>
<HEAD>
<STYLE TYPE="text/css">
  .formLetter { color: red }
</STYLE>

</HEAD>
<BODY>
  <p class="formLetter">Dear Sir, ...</p>
</BODY>
</HTML>


In the browser view, the text is not red Sad.

[Updated on: Wed, 12 February 2014 15:31]

Report message to a moderator

Re: How to use STYLE in HTML element? It not work [message #1245271 is a reply to message #1244410] Thu, 13 February 2014 14:57 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
It appears a style tag is not supported within an html text element, see this document paragraph 4.5.1

However you should be able to workaround this by defining your css rules in an external css resource, included at view time.
Re: How to use STYLE in HTML element? It not work [message #1245274 is a reply to message #1245271] Thu, 13 February 2014 15:01 Go to previous messageGo to next message
Martin Simon is currently offline Martin SimonFriend
Messages: 4
Registered: February 2014
Junior Member
Included at view time with Javascript? I tried this, but problem was that modal window informing about report opening did not closed.

I use this piece of code for load CSS:


<HTML>

<script type="text/javascript">
var $ = document; 
var cssId = 'myCss';  
if (!$.getElementById(cssId))
{
    var head  = $.getElementsByTagName('head')[0];
    var link  = $.createElement('link');
    link.id   = cssId;
    link.rel  = 'stylesheet';
    link.type = 'text/css';
    link.href = 'myStylesheet.css';
    link.media = 'all';
    head.appendChild(link);
}
</script>

<BODY>
  <p class="formLetter">Dear Sir, ...</p>
</BODY>
</HTML>

[Updated on: Thu, 13 February 2014 15:06]

Report message to a moderator

Re: How to use STYLE in HTML element? It not work [message #1245346 is a reply to message #1245274] Thu, 13 February 2014 17:22 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Actually i was thinking to something more native: in the outline view of the designer, if we right-click on the element Styles -> Use css file

We can include a css file from an absolute URI or from the resource path of BIRT. In your case, you need to check the option "Include CSS at view time"

index.php/fa/17468/0/

I hope this helps

[Updated on: Thu, 13 February 2014 17:24]

Report message to a moderator

Re: How to use STYLE in HTML element? It not work [message #1245543 is a reply to message #1245346] Fri, 14 February 2014 00:12 Go to previous messageGo to next message
Martin Simon is currently offline Martin SimonFriend
Messages: 4
Registered: February 2014
Junior Member
I know that we can include style, I tried it, it can not be applied to HTML field Sad, only for other visual elements. If I try to use defined names from this CSS in HTML field, it did nothing, like these styles was not visible from HTML field.

[Updated on: Fri, 14 February 2014 00:13]

Report message to a moderator

Re: How to use STYLE in HTML element? It not work [message #1245791 is a reply to message #1245543] Fri, 14 February 2014 09:16 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
It works for me Martin,

There is probably an issue with the path of the css file, you should check in the development console of Chrome (or whatever browser you like Smile) if a valid css link is inserted.

I joined a sample (4.3.1) where the title is an HTML text making use of a css class "ui-widget-header". This class is defined in this external css file, hosted on Google CDN. Here is what we see in HTML format:

index.php/fa/17474/0/

I hope this helps
Re: How to use STYLE in HTML element? It not work [message #1245910 is a reply to message #1245791] Fri, 14 February 2014 12:49 Go to previous message
Martin Simon is currently offline Martin SimonFriend
Messages: 4
Registered: February 2014
Junior Member
We use another solution - we put CSS styles in default BIRT styles.css, now are visible for us in HTML element.
Previous Topic:Base64 encoded background image missing in PDF
Next Topic:Birt vierwer and Birt Taglib bug from different webapp
Goto Forum:
  


Current Time: Wed Sep 18 22:01:35 GMT 2024

Powered by FUDForum. Page generated in 0.03431 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top