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)
Colorful Text
kosta
How can I style text with different colors.
Given the text: "test0 and test1" in one text element.
I want the first part "test1" to be black the second "and" white and "test1" blue.
How can I do that with the default BIRT styling without using span style's in the text element.
The styles imported from css or linked with css can be assign to the whole text element,
but can't be used as "class" like in HTML.
Beside that CSS can't be used in rptlibraries or is there any hack how to use them there?
I am using BIRT 2.6.2.
For any hints and suggestions, thank you very much.
Find more posts tagged with
Comments
mwilliams
So, you're using a text element? Or a data element?
kosta
I am using text element. but if there is any differences between text and data element I would like to know that too.
mwilliams
I haven't found a way to style only a portion of a text with a style from a css, by name, yet. However, I did find that if you used the style from the CSS on a hidden text element, that BIRT will add the style to the report. The only issue is that it will re-name the style something like "Style_1". So, you'd have to figure out what BIRT names your styles in the output before you could use it in a text box. If I find something else out, I'll let you know. I did find this bug report that addressed this issue. The "working" example provided, did not work for me. Please file a bug for this in the eclipse.org bugzilla.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=189409
kosta
Should I create new bug in eclipse bugzilla for using the css class name into a html formatted text element content?
Why have you used hidden text element for testing this one?
What about using css into rptlibraries?
mwilliams
What's your BIRT version? I'll make you a quick example of what I'm talking about.
As for the CSS in the library. If you go to the outline for the library, you'll see a "Themes" section. If you expand the section, you'll see the default theme. If you right click on the theme, you'll have the ability to import a CSS or use a CSS.
kosta
I am using BIRT 2.6.2.
What about using css into rptlibraries? Is that possible somehow?
mwilliams
The above was about inside your .rptlibrary. "Go to the outline for the library..."
I'll get an example of the css done, soon.
Sorry, I forgot to respond to the "should I file a new bug" question. Yes, please file a new bug for this and put the bug details in this thread for future reference. Thanks!
mwilliams
Ok. Take a look at this simple example. I have three text boxes. One is assigned the style, for the whole text box. The other uses the class in the span properties. If you delete the text box where the text is already yellow, the text in the other text boxes will not turn yellow. If you look closer, you'll see that I used class="style_1", instead of the actual style name. This is because BIRT renames the styles. You can see this if you look at the HTML output page source. Maybe this will help.
kosta
Here ist the bug that I created about this problem:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=378340
kosta
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="99828" data-time="1335816247" data-date="30 April 2012 - 01:04 PM"><p>
Ok. Take a look at this simple example. I have three text boxes. One is assigned the style, for the whole text box. The other uses the class in the span properties. If you delete the text box where the text is already yellow, the text in the other text boxes will not turn yellow. If you look closer, you'll see that I used class="style_1", instead of the actual style name. This is because BIRT renames the styles. You can see this if you look at the HTML output page source. Maybe this will help.<br /></p></blockquote>
<br />
The example work like you described for the HTML output. For doc and PDF it doesn't work that way.
kosta
About the rptlibrary I found what you meant.
Right click on one Theme (i.e. defaultTheme) and CSS options are in the menu.
Thank you.
mwilliams
You're very welcome. Yeah, I didn't check the PDF output for the text color. I guess we'll have to wait and see what they say on your bug report!