Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338588 - Setting the "Fit to Page" and "Fit to Height" print/page-setup options in BIRT reports exported to excel
Summary: Setting the "Fit to Page" and "Fit to Height" print/page-setup options in BIR...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.7.0   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard: Obsolete
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-01 16:17 EST by harshdhulia88 CLA
Modified: 2011-05-26 13:33 EDT (History)
1 user (show)

See Also:


Attachments
This file belongs to the org.eclipse.birt.report.engine.emitter.excel package and is in the org.eclipse.birt.report.engine.emitter.prototype.excel_2.6.2.r262_v20110215.jar file. (23.80 KB, text/plain)
2011-03-01 16:21 EST, harshdhulia88 CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description harshdhulia88 CLA 2011-03-01 16:17:42 EST
Build Identifier: 20100917-0705

I'm using BIRT 2.6. Consider a BIRT report with a table that has many columns with considerable width (generally exceeding the default width of the selected page type - letter, US Legal etc.). When such a report is exported to excel the print setting or page-setup in excel is not maintained properly. The columns of the table break and appear on different pages (e.g if the table has 10 columns, then 6 columns may appear on one page and the rest 4 will appear on some other page). This issue can be corrected by setting the "Fit to Page" and "Fit to Height" properties of the exported excel report in BIRT. I looked at the BIRT source code and i think that these properties can be set by adding a few lines to the ExcelXmlWriter.java file of the org.eclipse.birt.report.engine.emitter.excel package. I tried modifying the plugin source and building a jar file, but wasn't able to make the jar file work with the BIRT Report Designer. I'm attaching the modified ExcelXmlWriter.java file (changes are on line numbers 836-838 and 841-842 in the declareWorkSheetOptions method).

Reproducible: Sometimes

Steps to Reproduce:
1. Create a BIRT report with A4 letter layout and landscape orientation.
2. Add a table to the report with many columns (more than 6-7 should do) and put some dummy data.
3. Export the report to excel and go and see the print preview. All columns do not appear on the same page since the page-setup is not done properly by BIRT while exporting the report.
Comment 1 harshdhulia88 CLA 2011-03-01 16:21:59 EST
Created attachment 190093 [details]
This file belongs to the org.eclipse.birt.report.engine.emitter.excel package and is in the org.eclipse.birt.report.engine.emitter.prototype.excel_2.6.2.r262_v20110215.jar file.

I've made some changes to this file to set the "Fit to Page" and "Fit Height" options of the exported excel file of the BIRT report so that the print-setting/page-setup is set properly for excel. Please note that by setting the "Fit to Page" option, the scaling of the excel file doesn't need to be set as it will be determined automatically by excel. Changes are on line numbers 836-838 and 841-842 in the declareWorkSheetOptions method.
Comment 2 Xiaoying Gu CLA 2011-03-07 05:06:14 EST
This bug was reproducible in the 2.6.1 release, but can not be reproduced in the latest 2.6.2 release.

Set as fixed.