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

Bug 343928

Summary: BIRT output file size is too large
Product: z_Archived Reporter: Jiju <jijuelayedath>
Component: BIRTAssignee: Jianchao Li <jianchao.li>
Status: VERIFIED FIXED QA Contact: Xiaoying Gu <bluesoldier>
Severity: critical    
Priority: P3 CC: bluesoldier, jianchao.li
Version: 2.5.2   
Target Milestone: 3.7.0 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard: Obsolete

Description Jiju CLA 2011-04-27 02:38:30 EDT
We have some plain text report with HTML '<PRE>' tag for embedding on to a web page. The same we converted in to BIRT. But the output file size are too large
(some times X5 to X10 times bigger than the original output).

Is there any way to reduce the size of the BIRT reports?
Comment 1 Jiju CLA 2011-04-27 06:25:52 EDT
We have some plain text reports with HTML '<PRE>' tag for embedding on to a web
page. The same we converted in to BIRT. But the output file size are too large
(some times X5 to X10 times bigger than the original output).

Is there any way to reduce the output size of the BIRT reports?
Comment 2 Xiaoying Gu CLA 2011-04-28 02:29:40 EDT
Would you please attache a sample report for me to reproduce this issue?
Comment 3 Jiju CLA 2011-04-29 03:12:06 EDT
Thanks Xiaoying Gu. We will scrub the existing report and will upload it to Bugzilla.

Following are some of the observations we could make from the generated output.

BIRT report size – 91 KB; Legacy System HTML Report Size – 41 KB; Both these reports have the same data and are in HTML format.

We performed the below given exercise on the BIRT HTML output using a text editor and we could match/better the expected HTML size.
 
1.	Merge unmerged, unused cell – Reduced the overall size by 4 KB (New O/P Size – 87 KB)
2.	Each column has additional DIV to format a column – Removing these additional DIV reduces the size by 30 KB (New O/P Size – 57 KB)
3.	Remove Whitespaces (Tab, Newline) – reduces the size by 20 KB (New O/P Size – 37 KB) 

Based on our analysis we have the following questions:

1) Is there a way we can remove whitespaces (tab, newline) on the generated BIRT HTML output?
2) Is there a way we can avoid the extra DIV tag (on BIRT HTML output) and apply the style directly to TD tag?
Eg:
Expected output:
<TD align="center">Test Data</TD>
BIRT Output:
<TD class="style_7"><div class="style_8">Test Data</div></TD>

- Jiju
Comment 4 Jianchao Li CLA 2011-04-29 05:41:28 EDT
1) we will provide an option in HTMLRenderOption to ignore the whitespaces for generating the HTML output.
2) the DIV tag is used to contain the content of the data item in the cell, which is contained in a TD tag. The cell item and data item are different items so that they may have different styles. In addition, a cell item can have several data items and DIV tags are required to contain the data items.
There exists a workaround that you can overwrite our HTMLReportEmitter to ignore the DIV tags by yourself.
Comment 5 Jianchao Li CLA 2011-04-29 05:44:25 EDT
Reopen it since we should fix the first problem.
Comment 6 Jianchao Li CLA 2011-05-18 04:40:55 EDT
An option IHTMLRenderOption.HTML_ENABLE_COMPACT_MODE is added to control whether to enable the compact mode for html output. If the compact mode was enabled, the text indents(tabs) and new line seperators will be ignored.The fix was checked into 2.6.2 and head branch.
Comment 7 Xiaoying Gu CLA 2011-05-18 23:20:48 EDT
Verified in daily build 3.7.0.v20110510-0630 runtime

If add             
option.setOption(IHTMLRenderOption.HTML_ENABLE_COMPACT_MODE, true);
or        
option.setEnableCompactMode(true);
when rendering html reports, Tabs and line seperators will be omitted..