[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.birt] Re: How can I set a CSS class name for a report item?
|
- From: Jason Weathersby <jasonweathersby@xxxxxxxxxx>
- Date: Wed, 29 Oct 2008 10:17:19 -0400
- Newsgroups: eclipse.birt
- Organization: EclipseCorner
- User-agent: Thunderbird 2.0.0.17 (Windows/20080914)
Guenter,
Can you first try the "use CSS File" option for a blank report. This is
available in the right context of the styles node in the outline view.
In the filename specify a css file with the same names that can be used
in the designer and check the include CSS file at view time and specify
the url to the CSS you wish to use at view time. If you use this
method, in the designer BIRT will generate styles like:
In the designer:
<style type="text/css">
.style_report { font-family: serif; font-style: normal;
font-variant: normal; font-weight: normal; font-size: medium; color:
black; text-indent: 0em; letter-spacing: normal; word-spacing: normal;
text-transform: none; white-space: normal; line-height: normal;
direction: ltr;}
.style_2 { font-family: Arial; font-weight: bold; font-size:
x-small; color: rgb(0, 0, 0); padding: 0px; background-color: rgb(230,
236, 255);}
</style>
<link rel="stylesheet" type="text/css"
href="styles/LinksPastelBlue.css"></link>
and the item will have classnames like:
<tr class="style_1 myspecial-header" valign="top">
when the report is deployed to an appserver it will produce only this
for your referenced styles:
<link rel="stylesheet" type="text/css"
href="styles/LinksPastelBlue.css"></link>
and the same table row as above will look like:
<tr class="myspecial-header" valign="top">
So you can see in the designer it creates the style (ie style_2) but
also includes the link to the external style sheet. The actual
reference to a style will then have both style names and should default
to the external style sheet.
In the app server only the external style sheet is used.
I am not certain this answered your question though.
Jason
Guenter wrote:
Jason,
I am not able to get this to work.
What I want to achieve is:
- My HTML main page includes a stylesheet, then writes some header
information, then includes a BIRT generated report
- In the BIRT report, I want to use styles (CSS classes) that are defined in
the stylesheet included in the main page
- An extra item (if I get the above to work) is that I want to select the
used styles dynamically in some event handler
I tried to apply the style both in the beforeFactory event of the report
(which is rather difficult because I did not find a way in the API to
iterate over all items in the report) and via Highlight rules. In both
cases, I have the following problems:
- if I assign a style that is not defined in the current report design (or
the underlying theme), I get an exception "unknown style"
- if a style with that name is defined, I can set it, but the connection to
my original style is broken because BIRT does not apply the original class
name but rather defines a new class (Style_5 in my case) and uses this one
(I have tried to create a CSS file in the resource folder that defines the
same class names as my real stylesheet but without contents )
Do you have any hints how I could solve this?
Thanks,
Günter