Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316240

Summary: BIRT 2.5.2 doesn't support HTML table with absolute pixels width in report content
Product: z_Archived Reporter: Alex Chen <xiaodic>
Component: BIRTAssignee: JingwenShen <jingwen.shen>
Status: RESOLVED DUPLICATE QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier, bxu, jingwen.shen, jouyang, justinhimt, wlu, xuedm
Version: unspecified   
Target Milestone: 2.6.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch jar
none
source patch none

Description Alex Chen CLA 2010-06-09 01:44:31 EDT
Build Identifier: 2.5.2

We use BIRT engine API to generate MS word document in our code, but we get exception below when we upgrade to Eclipse 3.5.2:

=========================
Jun 7, 2010 5:54:09 PM org.eclipse.birt.report.engine.api.impl.RenderTask render
SEVERE: An error happened while running the report. Cause:
Throwable occurred: java.lang.IllegalArgumentException: "fromUnits"must be one of the absolute units(CM, IN, MM, PT).
at org.eclipse.birt.report.model.api.util.DimensionUtil.convert To(DimensionUtil.java:89)
at org.eclipse.birt.report.engine.ir.DimensionType.convertTo(Di mensionType.java:111)
at org.eclipse.birt.report.engine.emitter.wpml.WordUtil.convert To(WordUtil.java:100)
at org.eclipse.birt.report.engine.emitter.wpml.WordUtil.convert To(WordUtil.java:72)
at org.eclipse.birt.report.engine.emitter.wpml.AbstractEmitterI mpl.startTable(AbstractEmitterImpl.java:529)
at org.eclipse.birt.report.engine.emitter.wpml.DocEmitter.start Table(DocEmitter.java:362)
at org.eclipse.birt.report.engine.presentation.ContentEmitterVi sitor.visitTable(ContentEmitterVisitor.java:81)
at org.eclipse.birt.report.engine.content.impl.TableContent.acc ept(TableContent.java:104)
at org.eclipse.birt.report.engine.presentation.ContentEmitterVi sitor.visit(ContentEmitterVisitor.java:51)
at org.eclipse.birt.report.engine.presentation.ContentEmitterVi sitor.visitChildren(ContentEmitterVisitor.java:171)
at org.eclipse.birt.report.engine.presentation.ContentEmitterVi sitor.visitContainer(ContentEmitterVisitor.java:73)
at org.eclipse.birt.report.engine.content.impl.ContainerContent .accept(ContainerContent.java:42)
at org.eclipse.birt.report.engine.presentation.ContentEmitterVi sitor.visit(ContentEmitterVisitor.java:51)
at org.eclipse.birt.report.engine.presentation.ContentEmitterVi sitor.visitChildren(ContentEmitterVisitor.java:171)
at org.eclipse.birt.report.engine.emitter.wpml.DocEmitterImpl.s tartForeign(DocEmitterImpl.java:169)
at org.eclipse.birt.report.engine.emitter.wpml.DocEmitter.start Foreign(DocEmitter.java:282)
at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.st artContent(ContentEmitterUtil.java:77)
at org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEm itter.startContent(HTMLTableLayoutEmitter.java:146)
at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter .startForeign(ContentEmitterAdapter.java:168)
at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.st artContent(ContentEmitterUtil.java:77)
at org.eclipse.birt.report.engine.layout.html.buffer.DummyPageB uffer.startContent(DummyPageBuffer.java:125)
at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.st art(HTMLLeafItemLM.java:67)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:139)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.resumeLayout(HTMLInlineStackingLM.java:111)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.layoutNodes(HTMLInlineStackingLM.java:160)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.l ayoutChildren(HTMLTableBandLM.java:67)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou tChildren(HTMLTableLM.java:132)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:90)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:99)
at org.eclipse.birt.report.engine.api.impl.RenderTask$PageRange Render.render(RenderTask.java:577)
at org.eclipse.birt.report.engine.api.impl.RenderTask.render(Re nderTask.java:221)
at com.ibm.rmc.publishing.doc.service.DocumentGenerator$2.run(D ocumentGenerator.java:162)
at java.lang.Thread.run(Thread.java:735)
=========================

The BIRT engine in Eclipse3.5.2 is org.eclipse.birt.report.engine_2.5.2.v20100210.jar . 

We use HTML content in report, and we find if we change our HTML content like below:

***************
<br />
<table border="0" width="589" align="center">
    <tbody>
        <tr>
            <td width="96">
                <div align="center">
                    <a href="./../../../publish.openup.base/customcategories/getting_started_5684BDA6.html"
***************

to

***************
<br />
<table border="0" width="100%" align="center">
    <tbody>
        <tr>
            <td width="96">
                <div align="center">
                    <a href="./../../../publish.openup.base/customcategories/getting_started_5684BDA6.html"
***************

Then we can generate MS word document successfully, but from HTML specification, http://www.w3schools.com/tags/att_table_width.asp , user can use absolute pixel value for width attribute of table, so we think this is a bug of BIRT, also on Eclipse 3.3.2 platform(org.eclipse.birt.report.engine_2.2.2.r22x_v20080107.jar), our code works fine.

Thanks much!
--Alex

Reproducible: Always
Comment 1 JingwenShen CLA 2010-07-15 04:53:22 EDT
Can not reproduce on latest build.
Please update your birt version.
Comment 2 Alex Chen CLA 2010-07-18 22:57:58 EDT
Hi JingWen,

1. Which version did you use to test this issue?

2. Could you reproduce the issue with the version I reported?

3. Could you please create a patch for us based on the version I reported?

Thanks very much,
--Alex
Comment 3 JingwenShen CLA 2010-07-20 01:00:47 EDT
Created attachment 174696 [details]
patch jar

(1)I use Birt 2.6.0 realease version to test this issue.

(2)The problem exists on Birt2.5.2, and it was fixed on Birt2.6.0RC2.Please refer to bug #314099

(3)Please see the attachment for the patch for Birt2.5.2 realease.
Comment 4 JingwenShen CLA 2010-07-20 01:02:01 EDT
Set the resolution to duplicate.

*** This bug has been marked as a duplicate of bug 314099 ***
Comment 5 Alex Chen CLA 2010-08-02 02:14:03 EDT
Hi JingWen,

Could you please provide the source patch for this bug for Birt2.5.2 release?

Reason:
1. We need include the other fix in our product: https://bugs.eclipse.org/bugs/show_bug.cgi?id=316239
2. On Eclipse 3.5 platform, we need create feature patch for bug fix.

Thanks very much,
--Alex
Comment 6 JingwenShen CLA 2010-08-02 03:32:42 EDT
Created attachment 175689 [details]
source patch
Comment 7 justin himt CLA 2014-11-15 01:57:49 EST
You can see here more about..HTML table styling with CSS

http://www.corelangs.com/css/table/default.html

Justin