Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 234305 - View time style does not work after extending from library to report.
Summary: View time style does not work after extending from library to report.
Status: VERIFIED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.5.0 M5   Edit
Assignee: Jun Ouyang CLA
QA Contact: Maggie Shen CLA
URL:
Whiteboard: Obsolete
Keywords:
Depends on: 260025
Blocks:
  Show dependency tree
 
Reported: 2008-05-28 02:40 EDT by Maggie Shen CLA
Modified: 2009-05-26 22:17 EDT (History)
4 users (show)

See Also:


Attachments
report design,library and CSS, it's a zip file (2.68 KB, application/zip)
2008-05-28 03:17 EDT, Maggie Shen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maggie Shen CLA 2008-05-28 02:40:42 EDT
description:
View time style does not work after extending from library to report.

build id:
2.3.0 v20080528-0630

steps to reproduce:
1. New a library and insert a label.
2. Use CSS file at view time. Apply a view time style to the label.
3. New a report and extend the lable from library.
4. Preview in html.

Expected result:
View time style should take effect when preview in html.

Actual result:
View time style does not take effect when preview in html.
Comment 1 Rick Lu CLA 2008-05-28 02:54:20 EDT
What's view time style? Please upload the design file.
Comment 2 Maggie Shen CLA 2008-05-28 03:17:58 EDT
Created attachment 102306 [details]
report design,library and CSS, it's a zip file

The zip file contains a report design, a library, and two CSS. The only difference between the two CSS is that useCSS_red.css uses a red font color while local-yellow.css uses a yellow font color.
To reproduce, you need to copy local-yellow.css to d:\ of your computer and copy other three files under the current project, then preview the report design in html. The expected behavior is that the font color should be yellow, which is defined in the view time CSS.
Comment 3 Rick Lu CLA 2008-05-28 03:57:54 EDT
Need new Model APIs and also Engine supports for resource related issues. Schedule to 2.3.1.
Comment 4 Rick Lu CLA 2008-07-01 03:56:01 EDT
Need to provide methods to collection external CSS URL from libraries like ScriptLibs.
Comment 5 Xuelan Li CLA 2008-08-26 02:43:15 EDT
Add getAllExternalIncludedCsses in ReportDesignHandle to return the list of the IncludedCssStyleSheetHandle that set external URI and reside in the design iteself and the referred library theme. Assign Engine to do rest part.
Comment 6 Liang Yu CLA 2008-08-27 04:56:49 EDT
I have fixed the Engine part of this bug. But the case in Comment  #2 still can't work.

It only works for the elements which are not come from a report library. This part needs  Model team to fix it. So reassign this bug to Report.
Comment 7 Rick Lu CLA 2008-08-28 01:52:51 EDT
(In reply to comment #6)
> I have fixed the Engine part of this bug. But the case in Comment  #2 still
> can't work.
> 
> It only works for the elements which are not come from a report library. This
> part needs  Model team to fix it. So reassign this bug to Report.
> 

In BIRT, libraries and report are in hierarchy structure. That means a library style can be used indirectly in the report design. However, in the output html, it is a flat structure.

Thus, it causes the problem to locate which style one report element has used. For example, one report label may indirectly use "style1" in the lib1 by using the lib1's "libLabel1". And at the same time, the report has the "style1" locally. To follow the css specification, the style should have no namespace. But in such case, Engine must know the different between "lib1".style1 and "report.style1. If one design has multiple libraries, the case may become much more complicated. Looks the external css feature doesn't comply with current BIRT framework.

One suggestion is to disable external css feature in the library. If this feature is only applicable to the design, it will be much simple.
Comment 8 Wenfeng Li CLA 2008-08-28 17:54:31 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > I have fixed the Engine part of this bug. But the case in Comment  #2 still
> > can't work.
> > 
> > It only works for the elements which are not come from a report library. This
> > part needs  Model team to fix it. So reassign this bug to Report.
> > 
> In BIRT, libraries and report are in hierarchy structure. That means a library
> style can be used indirectly in the report design. However, in the output html,
> it is a flat structure.
> Thus, it causes the problem to locate which style one report element has used.
> For example, one report label may indirectly use "style1" in the lib1 by using
> the lib1's "libLabel1". And at the same time, the report has the "style1"
> locally. To follow the css specification, the style should have no namespace.
> But in such case, Engine must know the different between "lib1".style1 and
> "report.style1. If one design has multiple libraries, the case may become much
> more complicated. Looks the external css feature doesn't comply with current
> BIRT framework.
> One suggestion is to disable external css feature in the library. If this
> feature is only applicable to the design, it will be much simple.


If a report local style overwrites the external CSS style in library, I think it is correct bhavior that the external CSS style is not used in view time. 

There is a separate bugzilla about NOT to auto merge styles into an auto generated classes for report elements,  suggest consider this bug together with that project in 2.5.0.
Comment 9 Wei Yan CLA 2008-12-28 21:42:14 EST
We known that for each report item, the user can define the style in following places:

1. define the style in the default style "report".
2. define the style in the element's default style, such as label-style, data-style etc.
3. define the style as the element's class, such as class="style-name"
4. define the style as the element's inline properties.
5. change the style as the element's script.

To output the styles as it is, BIRT needs:

1. change the styleClass in the IContent from String to String[].
2. change the implementation of the script API to support multiple style classes as "class, class".
3. change the CSS engine to support String[] classes.
4. change the implementation of HTML emitter to support multiple styleClasses.
Comment 10 Jun Ouyang CLA 2009-01-18 22:19:25 EST
Fixed.

For the original case, it still can't be supported and it won't be fixed.
For a view time style specified in library:
1. the named styles do not work.
2. the selector styles work.
Comment 11 Maggie Shen CLA 2009-01-21 04:11:51 EST
Closing this bug as extending view time style from library to report will not be supported. Will submit another bug about the pre-defined style using CSS file.
Comment 12 Jun Ouyang CLA 2009-05-19 22:16:09 EDT
Due to bug 276658, this feature is rollbacked. 
According to css spec, the priority of styles are determined by the sequence the styles are defined but not that they are used. This makes Wei's solution in comment #9 is not able to be accomplished. We need to find new solution.
Comment 13 Wei Yan CLA 2009-05-24 23:13:34 EDT
Due to the limitation of the CSS, BIRT can't support this feature.
Comment 14 Maggie Shen CLA 2009-05-26 22:17:53 EDT
close.