Bug 218756 - "Can shrink" property does not work for HTML
Summary: "Can shrink" property does not work for HTML
Status: RESOLVED FIXED
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: ---   Edit
Assignee: Liang Yu CLA
QA Contact:
URL:
Whiteboard: Autoed,G
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-13 04:09 EST by Kirill A. Balod CLA
Modified: 2010-03-25 02:27 EDT (History)
2 users (show)

See Also:


Attachments
An example of workaround. (5.93 KB, application/octet-stream)
2008-02-14 21:35 EST, Liang Yu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kirill A. Balod CLA 2008-02-13 04:09:12 EST
Steps To Reproduce:
1. Create Grid element with 3 columns and 1 row in empty report
2. Make "width" property of Grid empty
3. Set "Can shrink" to true
4. Put label in each cell of grid
5. Enter "aaaa", "aaaaaaaa", "aaaaaaaaaaaa" values in corresponded label
6. Swich to preview - the grid has 100% width and output look like:
aaaa    aaaaaaaa        aaaaaaaaaaaa            |
but should 
aaaa aaaaaaaa aaaaaaaaaaaa|

The same incorrect behavior for table item.
It is regression because it worked in 2.1.1

More information:
HTML emmiter always produce <table 
cellpadding="0" style=" border-collapse: collapse; empty-cells: show; width:100%;"> in spite of width is empty.

Probably "Can shrink" property should do somethink else but there is not description of it in help. In any case if "width" property is empty HTML emmiter should not set 100% width.

Related bugs: 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=207020
https://bugs.eclipse.org/bugs/show_bug.cgi?id=177498
Comment 1 Kirill A. Balod CLA 2008-02-13 04:16:26 EST
It is important for us because BIRT does not provide ability to put several elements into one line (somethink like X-layout) and simplest way to do it is table which can shrink by width.
Comment 2 Liang Yu CLA 2008-02-14 21:35:31 EST
Created attachment 89804 [details]
An example of  workaround.

Here is a workaround: Set the table's width to 1%.

If this workaround can work, I will set this bug as duplicated of the bug 207020.

Thanks.
Comment 3 Kirill A. Balod CLA 2008-02-15 03:57:26 EST
Yes it works, but I not sure that this bug could be marked as duplicate of #207020. Because I reported about wrong behavior but 207020 is improvement.
Comment 4 Kirill A. Balod CLA 2008-02-15 04:11:05 EST
And once more - in PDF format this report with such workaround looks very ugly! 

So I realy think that this bug not the same as 207020 and can not be marked as duplicate. The first - this bug about incorrect behavior of HTML emmiter and the second - this functionality was in past (BIRT 2.1.1) and is lost now.
Comment 5 Liang Yu CLA 2008-02-19 23:30:29 EST
In current BIRT, table's "shrink" has different meaning with other element. We only use the table's "shrink" to decide outputting "fixed" or not. We chose this solution, because PDF can't implement the table's "shrink" completely. So if a table doesn't have a width, we will output the width as "100%".

We can make an improvement for HTML: don't output the width for a shrink table.
But we can't change the PDF output.

PS: after the change, the table's shrink will have different meaning between HTML and PDF.


Thanks.
Comment 6 Liang Yu CLA 2008-02-21 22:43:36 EST
Fixed.

Now shrink table will not output the 100% as the default width in HTML.


Hi, Kirill A. Balod.
You can download current BIRT code and try it again:
1. remove the default width 100% from the table.
2. set the true to the table's shrink.
3. if you want an inline table, please set the display of the table as inline.

Thanks.