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

Bug 243259

Summary: [Improve Report Layout Capabilities] Support diagonal line
Product: z_Archived Reporter: Sissi Zhu <szhu>
Component: BIRTAssignee: Gang Liu <hustlg>
Status: CLOSED FIXED QA Contact: Tianli Zhang <tzhang>
Severity: enhancement    
Priority: P3 CC: bluesoldier, jasonweathersby, jingwen.shen, rkanguri, rlu, wenfeng.fwd, whe, wyan, yliang, zqian
Version: unspecifiedKeywords: plan
Target Milestone: 2.5.0 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard: Autoed
Attachments:
Description Flags
HTML sample
none
A design file for testing. none

Description Sissi Zhu CLA 2008-08-05 23:49:09 EDT
Many Chinese reports use diagonal line, BIRT shall support it. I will attach the template later.
Comment 1 Rick Lu CLA 2008-08-06 01:59:43 EDT
Add CC members for the cross-team discussion.
Comment 2 Wei Yan CLA 2008-08-06 03:03:12 EDT
there are two solutions for this issue:

1. MS office style. In MS office, the CELL has two extra border styles:
   tl2br (Top left to bottom right) and tr2bl (Top right to bottom left).

  To use such solution, we need add 6 more property to BIRT:
   tl2br-border-style
   tl2br-border-width
   tl2br-border-color
   tr2bl-border-style
   tr2bl-border-width
   tr2bl-border-color

2. Open office style. In Open office, the user can draw lines in the cells. Then the lines are convert to graphics.

Personally I prefer the open office style as it is more extensible. To do so, we need:

1. Free-layout-container. The free-layout-container must have width/height defined. It can be placed into another free layout container or normal container.

2. Free-layout-component. Any items with x, y are free-layout components. They must be placed into a free-layout-container. The x, y is the offset from the free-layout-container.

3. Add a set of graphics components. All the graphics components are free-layout-component, so they must have x, y and are placed into the free-layout-container.

To resolve this issue, the user need place a free layout container into the table header, draw a line in the container and place two text item in that container.

A sample HTML example attached.


Comment 3 Wei Yan CLA 2008-08-06 03:04:10 EDT
Created attachment 109267 [details]
HTML sample
Comment 4 Zhiqiang Qian CLA 2008-08-06 05:15:50 EDT
I prefer the second free-layout-container solution too. This is more flexible. By this means, we can achieve many more report styles that cannot done by flow layout.
Comment 5 Zhiqiang Qian CLA 2008-08-06 05:19:55 EDT
I prefer the second free-layout-container solution too. This is more flexible. By this means, we can achieve many more report styles that cannot done by flow layout. Currently in ROM, we already have the FreeForm element, we can revisit it see if already meet the free-layout-container requirement.
Comment 6 Rick Lu CLA 2008-08-06 05:35:39 EDT
+1 to the open office solution. Can use ROM defined freeform, line report items for such feature. 

Has a question also. X and Y are relative position to the free-layout-container. That means these values can be overlapped. For example, a text item can overlap with another text item. So, need to introduce zIndex for report items, right?

BTW, in html, to render a line, Engine will always output the line as a picture, right? Not sure whether the picture backgroud color will be transparent or not. 
Comment 7 Wei Yan CLA 2008-08-06 05:56:54 EDT
> Has a question also. X and Y are relative position to the
> free-layout-container. That means these values can be overlapped. For example,
> a text item can overlap with another text item. So, need to introduce zIndex
> for report items, right?

Yes, we need use the zIndex to control the order of overlapped of elements.

> 
> BTW, in html, to render a line, Engine will always output the line as a
> picture, right? Not sure whether the picture backgroud color will be
> transparent or not. 
> 
In HTML, ENGINE will convert the graphic objects to image. The image's background MUST be transparent otherwise it may overlap other items.

Comment 8 Wenfeng Li CLA 2008-08-13 20:57:28 EDT
I suggest we defer adding freeform-layout-container report item and freelayout-drawing-object report item in 2.5.0 release.  For these two report items, we shall not ignore data binding property, since user might want to use result set to draw objects in the freeform container, or write scripts that access the result set.

For this feature, can we use a 3rd solution:
1. create a new report item that is similar to grid, except that it will always split the grid by diagnoal lines.
2. properties on this diagonal grid are: N number of diagnoal lines, diagnoal corner (upperleft, upperright, lowerleft, lowerright), line widht, line color, line style.
3. engine will draw N diagonal lines starting from the diagnoal corner by spliting the straight angle into 90/(N+1) degree each.
4. the diagnoal grid will have (N+1) cells, where user can put other report items into it.

Question:

How will engine draw lines in various output format?  Will it depends on emitters?   I think using image in PDF or postscript will not be precise enough to have high quality print output.  Does Excel support diagnoal line natively?
Comment 9 Rick Lu CLA 2008-08-14 03:57:09 EDT
This is a cross-team issue. Defer to 2.5.0 for implementation.
Comment 10 hong chen CLA 2008-10-17 01:55:32 EDT
1.added diagonalNumber,antidiagonalLineNumber,diagonalThickness,antidiagonalThickness,diagonalStyle and antidiagonalStyle properties in cell element.
2. provided api to handle these properties in CellHandle
3.provided simple api of these properties  in model and engine.


Comment 11 Rick Lu CLA 2008-10-17 02:04:51 EDT
Also need to supports on Engine and UI. Reassign to Engine first.
Comment 12 Wei Yan CLA 2009-02-04 03:32:03 EST
need more time to resolve those issues.
Comment 13 Liang Yu CLA 2009-02-25 00:51:29 EST
Checked in the first version codes of the Engine part. There are still some works needs to do, like solving the conflict between diagonal line image and cell background, implementation of the diagonal style and width,etc.

Reassign this bug to UI.
Please reassign this bug back to me when the UI's work is done. I will continue work on the Engine's part.

Thanks.
Comment 14 Zhiqiang Qian CLA 2009-02-26 01:54:57 EST
Need the UI mockup first.
Comment 15 Liang Yu CLA 2009-03-04 04:48:52 EST
Implemented the diagonal width in HTML.
Implemented part of the diagonal styles in HTML: solid, dashed, dotted. In current BIRT HTML the double diagonal will be treated as solid diagonal.
Comment 16 Liang Yu CLA 2009-03-04 04:53:05 EST
Created attachment 127452 [details]
A design file for testing.
Comment 17 JingwenShen CLA 2009-03-09 04:34:24 EDT
Outputted diagonal line in word emitter.
Supported diagonal line style:dotted, dashed, solid.
Supported diagonal line width and color. 
Comment 18 Jason Weathersby CLA 2009-04-01 01:18:03 EDT
The test report does not appear to work if the /preview mapping is used in the viewer.  It works with the /frameset mapping.
Comment 19 Liang Yu CLA 2009-04-17 01:37:54 EDT
I have just fix a problem in HTML emitter. In previous codes I have used diagonalStyle for the antidiagonal line. It's not correct. The antidiagonal line should use the antidiagonalStyle.
Comment 20 Liang Yu CLA 2009-04-17 01:43:22 EDT
In current BIRT, every cell has six properties:
Diagonal number
Diagonal style
Diagonal thickness
Antidiagonal number
Antidiagonal style
Antidiagonal thickness


The number that Engine supports is 0-3. If the number is less than 0, Engine will treat it as 0. If the number is bigger than 3, Engine will treat it as 3. The cell will be divided by surface area.
The styles that Engine supports are ¡°solid¡±, ¡°dashed¡± and ¡°dotted¡±. Any other styles will be treated as ¡°solid¡±.
The diagonal cell must have an absolute height and width.
The cell¡¯s ¡°color¡± property will be used for diagonal line and antidiagonal line too.
In HTML there is till a problem not solved: if the cell has a background color, the background color will cover the diagonal line in Firefox. It works well for IE6, IE7 and IE8.
Now only the HTML and DOC have implemented the function. Other emitter will implement it later. So after other team finishes the work, please reassign the bug back to Engine for implementation on other emitters.

Thanks.
Comment 21 Liang Yu CLA 2009-04-17 01:50:08 EDT
(In reply to comment #18)
> The test report does not appear to work if the /preview mapping is used in the
> viewer.  It works with the /frameset mapping.
> 

I have tested it with Firefox 3.0.8, IE6, IE7 and IE8 in run, preview, frameset model. They all work well.

Can you provide more information to help us to reproduce the problem? Like which date building BIRT are you using? Or provide the HTML source when the err shows.

Thanks.
Comment 22 Rima Kanguri CLA 2009-04-21 14:28:02 EDT
For the UI changes i have logged a separate bugzilla entry
https://bugs.eclipse.org/bugs/show_bug.cgi?id=273109

Please use this bugzilla to complete all the engine changes and open issues

For testing, currently user can use the advanced properties view to set the properties.
Comment 23 Wei Yan CLA 2009-04-27 23:16:17 EDT
HTML, Word output has support the diagonal line, PDF/PS/PPT need also support it.
Comment 24 Gang Liu CLA 2009-05-07 22:28:32 EDT
supported in ps/postscript/ppt
Comment 25 Tianli Zhang CLA 2009-05-12 05:22:57 EDT
Verified in 2.5.0 v20090512-0630 build, diagonal line is supported in html/pdf/doc/postscript/ppt. Other issues please refer to new entries. Mark this bug as verified first.
Comment 26 Sissi Zhu CLA 2009-06-19 01:49:50 EDT
close.