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

Bug 339070

Summary: Excel: Grid does not fit on page. Extra column generated.
Product: z_Archived Reporter: Dirk Gabler <dirk.gabler>
Component: BIRTAssignee: Ruo Yin <ruo.yin>
Status: VERIFIED INVALID QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier, dirk.gabler, jouyang
Version: unspecified   
Target Milestone: 3.7.0 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard: Obsolete
Attachments:
Description Flags
ReportDesign to show non fitting grid
none
Result-XLS
none
created by 2.6.2 release
none
Excel-Screenshot of first page (2 pages result)
none
Screenshot of the XLS print preview
none
screenshot of office 2003 on xp
none
1 row, 3 columns
none
print_preview of 1row
none
Birt Designer to excel
none
widthAdjusted.jpg none

Description Dirk Gabler CLA 2011-03-07 05:30:58 EST
Build Identifier: 2.6.2

If I create a grid with X columns which should (by summarizing the column widths) fit on one page, it does NOT fit. An extra column is also generated.

In the attached sample, I have 3 columns with a total width of 19cm (4+7+8).
The right and left page margin is 0,66cm, so the grid should actually fit on a A4-Page which has a width of 21cm. 

Reproducible: Always

Steps to Reproduce:
1. Open the attached file with report designer 2.6.2
2. Run -> View Report -> In Web Viewer
3. In Web Viewer than do "Export to Excel"
4. Do a "show page" in Excel and you will see, that the first page contains 2 columns and the second page the third column. I would expect all 3 columns on the first page.
Comment 1 Dirk Gabler CLA 2011-03-07 05:33:30 EST
Created attachment 190530 [details]
ReportDesign to show non fitting grid

This report design contains a grid with 3 columns which should fit on one page.
In Excel it results in 2 pages. 
The exported excel XML file also contains one extra column.
Comment 2 Dirk Gabler CLA 2011-03-07 06:08:50 EST
Created attachment 190537 [details]
Result-XLS
Comment 3 Xiaoying Gu CLA 2011-03-08 21:52:45 EST
Hi Dirk,

I can not reproduce this issue in the 2.6.2 release build, buildid:<2.6.2.v20110219-1842>.

It seems that this bugs was fixed in the official release available few days later.
Comment 4 Dirk Gabler CLA 2011-03-09 03:12:46 EST
Hi,

I did use the official 2.6.2 release!
I've just downloaded several packages (birt-report-designer-all-in-one-2_6_2.zip, birt-rcp-report-designer-2_6_2.zip) again and tried it again. Same result.
If I create new reports with this official version, the build-id shown is always
"Eclipse BIRT Designer Version 2.6.2.r262_v20110209 Build <2.6.2.v20110214-1523>"
If you create a new report design, what version is shown in the rptdesign-XML?
Is there any newer version you have which is not provided as download?

Can you please send me your XLS-result, so that I can see if it looks better?
What is the difference in your XLS-result to mine (attached)? 
How many pages do you get if you open the Result-XLS attached?

Thanks in advance,
Dirk
Comment 5 Xiaoying Gu CLA 2011-03-09 03:48:34 EST
I downloaded the 2.6.2 release All-In-One package from: http://download.eclipse.org/birt/downloads/build.php?build=R-R1-2_6_2-201102191842
(chose the Asian [China] Actuate Shanghai (http) mirror)

After created a blank report in the all-in-one, the build id was shown as:
Eclipse BIRT Designer Version 2.6.2.r262_v20110209 Build <2.6.2.v20110219-1842>

The output xls file was attached.
Comment 6 Xiaoying Gu CLA 2011-03-09 03:49:07 EST
Created attachment 190736 [details]
created by 2.6.2 release
Comment 7 Dirk Gabler CLA 2011-03-09 04:20:22 EST
Ok,

for some reason the downloadable packages on the german mirror are different ones, but the birt-version seems to be the same:

Mine:  Eclipse BIRT Designer Version 2.6.2.r262_v20110209
Yours: Eclipse BIRT Designer Version 2.6.2.r262_v20110209

I do not think that there are differences in the versions but will try the shanghai-download also.

What version of Excel did you try? If I open your XLS output I still have the same problem. 
Can you please open the file in Excel, do a page preview and make sure that all fits on one page? See my new attachement how it looks like for me.

Thanks in advance,
Dirk
Comment 8 Dirk Gabler CLA 2011-03-09 04:21:23 EST
Created attachment 190738 [details]
Excel-Screenshot of first page (2 pages result)
Comment 9 Xiaoying Gu CLA 2011-03-09 04:39:51 EST
I opened the XLS file I uploaded both in excel 2003 and excel 2007, both works fine in print preview. 3 columns were drawn on the 1st page and only 1 page was generated.
Please see my screenshot.

BTW, the build id <2.6.2.v20110219-1842> indicates the actual build time of that build. So if your id was <2.6.2.v20110214-1523>, it might be an interim build. I'm not sure why the German mirror did not sync the correct one? Actually there was no 2.6.2.v20110214-1523 build on the Eclipse main download site now.
Comment 10 Xiaoying Gu CLA 2011-03-09 04:41:01 EST
Created attachment 190740 [details]
Screenshot of the XLS print preview
Comment 11 Dirk Gabler CLA 2011-03-11 07:11:47 EST
Hi,

can you please send me your rptdesign-file after you have opened it and saved it with your Birt-Version. I would like to check, if there are any other differences. 

What exakt version of Excel 2003 did you use on what version of windows?

Thanks in advance,
Dirk
Comment 12 Xiaoying Gu CLA 2011-03-13 21:58:07 EDT
(In reply to comment #11)
> Hi,
> 
> can you please send me your rptdesign-file after you have opened it and saved
> it with your Birt-Version. I would like to check, if there are any other
> differences. 
> 
> What exakt version of Excel 2003 did you use on what version of windows?
> 
> Thanks in advance,
> Dirk

Dirk,

I open the report you attached directly in the eclipse and did not make any change, so the save button is not available.

I was using Windows 7, jdk1.6 to run the all-in-one.
Can you check the plugins folder that xls emitter plugin version is:
org.eclipse.birt.report.engine.emitter.prototype.excel_2.6.2.r262_v20110215.jar?
Comment 13 Dirk Gabler CLA 2011-03-14 06:14:30 EDT
Yes, the plugin-folder contains:
org.eclipse.birt.report.engine.emitter.prototype.excel_2.6.2.r262_v20110215.jar

I'm also using JDK1.6 but on a Windows XP with Excel 2003 (SP3)

It looks like I have to go back to my patched 2.6.1-Version. right?
Comment 14 Xiaoying Gu CLA 2011-03-14 06:44:21 EDT
Ok, I finally succeed
Comment 15 Xiaoying Gu CLA 2011-03-14 06:47:10 EDT
OK, I finally can produce this issue with office2003 + windows XP + jdk 1.6. 
The output xls file has 2 pages. But this time the 3 columns of first row appears on the first page, the 2nd page should be caused by the 2nd row.

In the generated xls file, the second row has 4 columns, actually it should be 3.

Note that the exported xls still print fine in office 2007 version.
Comment 16 Xiaoying Gu CLA 2011-03-14 06:47:50 EDT
Created attachment 191098 [details]
screenshot of office 2003 on xp
Comment 17 Dirk Gabler CLA 2011-03-14 07:06:45 EDT
OK, we are coming closer to the problem.
Can you please try the rptdesign (A4-Test_1row_3columns.rptdesign) attached and let me know how it looks on your XP.
If you look in the resulting XML (XLS) you will see, that 4 columns are generated (as I mentioned in my original post):

<Worksheet ss:Name="Report">
	<ss:Table>
		<ss:Column ss:Width="113.28" ss:AutoFitWidth="0"/>
		<ss:Column ss:Width="198.528" ss:AutoFitWidth="0"/>
		<ss:Column ss:Width="226.688" ss:AutoFitWidth="0"/>
		<ss:Column ss:Width="19.328" ss:AutoFitWidth="0"/>

Cheers,
Dirk
Comment 18 Dirk Gabler CLA 2011-03-14 07:07:16 EDT
Created attachment 191102 [details]
1 row, 3 columns
Comment 19 Xiaoying Gu CLA 2011-03-23 02:26:18 EDT
Created attachment 191724 [details]
print_preview of 1row

The new generated xls file has the same xml as you pasted in comment 17(4 columns). But in excel print preview, it shows only 1 page.
Comment 20 Ruo Yin CLA 2011-04-20 01:26:36 EDT
Created attachment 193650 [details]
Birt Designer to excel
Comment 21 Ruo Yin CLA 2011-04-20 01:27:48 EDT
Created attachment 193651 [details]
widthAdjusted.jpg
Comment 22 Ruo Yin CLA 2011-04-20 01:38:01 EDT
1. The xml shows four columns because the report is using fixed layout so the last column is add here to fill the page width. However only the first 3 columns have data so the last column won't appear in print preview. The last column won't appear if report design is set to "auto layout" but the result is the same.
2. Excel has adjusted column width in print preview, page layout view and actual printing according the default font used. This can be verified using page layout view in excel 2007 (excel 2003 doesn't provide such function). As shown in Designer_to_excel.jpg, we preserved exact column width for each cell compared to designer under 96 dpi. 
In excel 2007, select "view" on menu then "Page Layout", the first column width becomes 162 pixels - 4.29 cm instead of 151 pixels - 4 cm (refer to widthAdjusted.jpg) for default font "Calibri 11" and that's why the three columns can't fit in one row. You can see these numbers by holding left mouse button down on column separator. If excel's default font is changed to "Arial 12", in page layout view you'll find the first column becomes 150 pixels - 3.97 cm.  You can change excel default font by clicking the office button on top left corner -> excel options -> "popular" tab -> on the left "when creating new workbooks" use this font.
Comment 23 Dirk Gabler CLA 2011-04-20 05:55:05 EDT
(In reply to comment #22)

Great answer, thank you! 
I came to the similar conclusion that the default font in excel confuses me :-) I've changed my way of desiging and using pixel-values in the designer now.
Comment 24 Xiaoying Gu CLA 2011-04-24 23:42:28 EDT
Verified