Bug 229541 - BIRT designer does not pick up changes to CSS file
Summary: BIRT designer does not pick up changes to CSS file
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.2.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Birt-ReportDesigner CLA
QA Contact: Maggie Shen CLA
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2008-04-30 00:26 EDT by Paul Rogers CLA
Modified: 2008-12-22 00:30 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Rogers CLA 2008-04-30 00:26:35 EDT
Create a CSS file in the Resources folder of your BIRT project. Call it "sample.css". Create a style called sample-style as follows:

sample-style { font-size: 18pt; color: blue; }

Create a BIRT report. Import sample.css into your report. Create a label with the text "Sample label". Assign the imported "SAMPLE-STYLE" (sic) to the label. The label appears formatted according to the style. So far so good.

Now, go back to the CSS style and change the style:

sample-style { font-size: 10pt; color: red; }

Save the file. Go back to your BIRT report. Notice that your label still has the old style.

Apparently, the user is supposed to go into the library view, select the CSS file, and use the "Refresh" option from the context menu. Let's try it. Hmmm... Still nothing.

The actual workaround that does work is to close the report (by clicking the X in the report's tab) and then reopening the report.

Expected that BIRT would detect changes to the CSS file when the file is saved, and do an automatic refresh. Eclipse clearly supports this mechanism: saving a Java file causes related files to rebuild to pick up changes.
Comment 1 Zhiqiang Qian CLA 2008-05-05 00:18:33 EDT
You need select "Reload CSS File" action in Outline View upon report design node or CSS style node to refresh the linked CSS values. The "refresh" action in Library Explorer View is used to refresh library resources. 
Comment 2 Paul Rogers CLA 2008-05-05 20:34:39 EDT
(In reply to comment #1)
> You need select "Reload CSS File" action in Outline View upon report design
> node or CSS style node to refresh the linked CSS values. The "refresh" action
> in Library Explorer View is used to refresh library resources. 
> 

Thanks for the clarification. The issue remains, however, that current behavior is awkward.

For comparison, Eclipse works with Java files. When one changes a Java file, other Java files are recompiled to pick up the change. Eclipse provides a refresh for Java projects, but this is needed only if the file is changed, added, or removed outside of Eclipse.

In the case described here, I modified the CSS file within Eclipse. The expectation would be that BIRT would follow the Java Tools pattern and reload the CSS file after changes.

IMHO, there is only one right thing to do after a CSS change: go into each open report that uses the CSS file and refresh. When multiple reports are open, this process is both tedious and error prone. It is exactly the kind of thing that the tool should do automatically.