Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Birt styles priority(Birt styles are broken when the report is embedded in uPortal)
Birt styles priority [message #874763] Mon, 21 May 2012 13:58 Go to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Hi,

When we define styles properties in a report, it appears Birt generates the css classes at the top of the report, for example on a table header:

.style_31 {color:white}


When a report is embedded in a portal, and if this portal globally defines the css table header, then it will override the birt style. For example, uPortal adds a css class 'uP' on the body element of the page, and in the portal css there is something like:

.uP th {color:black}


Because of the 'th' tag, the weight is stronger in the portal css, and the birt table header style is overridden. Thus, the whole styles are completely mixed and the report cannot be used. I wonder if there would be a way to increase the birt styles weight, for example if the class generated by birt was such below it would resolve most of the issues:

.style_31 {color:white!important}


Since these classe names can be namespaced, it could not disturb the other page components. If it is not currently possible, would it be a good idea to submit this feature?

thanks

[Updated on: Mon, 21 May 2012 14:00]

Report message to a moderator

Re: Birt styles priority [message #874902 is a reply to message #874763] Mon, 21 May 2012 17:57 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

This would be a good enhancement request. Do you want to open a
bugzilla for it?

Jason


On 5/21/2012 9:58 AM, donino donino wrote:
> Hi,
> When we define styles properties in a report, it appears Birt generates
> the css classes at the top of the report, for example on a table header:
>
> style_31 {color:white}
>
> When a report is embedded in a portal, and if this portal globally
> defines the css table header, then it will override the birt style. For
> example, uPortal adds a css class 'uP' ont the body element of the page,
> and in the portal css there is something like:
>
> uP th {color:black}
>
> Because of the 'th' tag, the weight is stronger in the portal css, and
> the birt table header style is overridden. Thus, the whole styles are
> completely mixed and the report cannot be used.
>
> I wonder if there would be a way to increase the birt styles weight, for
> example if the class generated by birt was such below it would resolve
> most of the issues:
>
> style_31 {color:white!important}
>
> Since these classe names can be namespaced, it could not disturb the
> other page components.
>
> If it is not currently possible, would it be a good idea to submit this
> feature?
>
> thanks
Re: Birt styles priority [message #875158 is a reply to message #874902] Tue, 22 May 2012 08:42 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Jason,

This enhancement request has been logged as Bug 380216

Thanks
Re: Birt styles priority [message #875383 is a reply to message #875158] Tue, 22 May 2012 16:22 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Thanks for logging it. BTW have you tried to import a style likeL

..mystyle
{
background-color: Yellow!important
}

and then apply the style and see if that makes a difference?
You could also look at trying the link at view time styles.
http://www.eclipse.org/birt/phoenix/project/notable2.3.php#jump_9


Jason

On 5/22/2012 4:42 AM, donino donino wrote:
> Jason,
>
> This enhancement request has been logged as
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=380216
>
> Thanks
Re: Birt styles priority [message #875450 is a reply to message #875383] Tue, 22 May 2012 19:21 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Jason,

When the styles are imported, the !important annotation is removed and will not be used. If the css file is linked at view time then it will work, though i'm not sure how the relative path must be filled for a css file: is it relative to the resource path, the web application or the report?
However it is in my opinion much more efficient to take advantage of the eclipse birt designer to style the report items.

thanks
Re: Birt styles priority [message #875497 is a reply to message #875450] Tue, 22 May 2012 21:13 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I believe this is relative to the web app. If you use this technique
both the view time css and designer css files will be in the output.
The engine will try to locate the external style first and if not found
it will default to designer styles. I agree with you that the better
option is to let the designer handle it.

Jason

On 5/22/2012 3:21 PM, donino donino wrote:
> Jason,
>
> When the styles are imported, the !important annotation is removed and
> will not be used. If the css file is linked at view time then it will
> work, though i'm not sure how the relative path must be filled for a css
> file: is it relative to the resource path, the web application or the
> report? However it is in my opinion much more efficient to take
> advantage of the eclipse birt designer to style the report items.
> thanks
Previous Topic:Button in a BIRT report
Next Topic:Viewer request encoding
Goto Forum:
  


Current Time: Thu Apr 25 22:55:19 GMT 2024

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

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

Back to the top