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

Bug 361443

Summary: Excel ODA
Product: z_Archived Reporter: Megha Nidhi Dahal <arpandahal>
Component: BIRTAssignee: Linda Chan <lchan>
Status: RESOLVED FIXED QA Contact: Liwen Chen <lchen>
Severity: enhancement    
Priority: P3 CC: arpandahal, bluesoldier, jasonweathersby
Version: 3.7.0   
Target Milestone: 4.2.0 M7   
Hardware: PC   
OS: Windows 7   
URL: http://code.google.com/a/eclipselabs.org/p/excel-oda/
Whiteboard:
Bug Depends on:    
Bug Blocks: 366908    
Attachments:
Description Flags
Source code attachment
none
Patch file on revision 9 to fix date reading problem
none
Updated source code attachment
arpandahal: review?
source code none

Description Megha Nidhi Dahal CLA 2011-10-19 13:51:28 EDT
Build Identifier: M20110210-1200

BIRT doesn't provide a straight forward way to use Microsoft excel file as a source. This extension will provide a simple and straight forward mechanism to use Microsoft Excel files as Data Source.

The plugin project is hosted at: http://code.google.com/a/eclipselabs.org/p/excel-oda/

Reproducible: Always
Comment 1 Megha Nidhi Dahal CLA 2011-10-26 01:03:14 EDT
Created attachment 205964 [details]
Source code attachment

This plugin project depends apache poi 3.7.
Comment 2 Jason Weathersby CLA 2011-11-29 13:49:42 EST
Some additional work needs to be done to handle poi issue with large xls files.
http://stackoverflow.com/questions/2159635/excel-poi-3-5-workbook-java-heap-space-exception

We have two options.  One tell the users to up the heap space or re-write the code to use the event model approach based on SAX.

http://poi.apache.org/spreadsheet/how-to.html#xssf_sax_api
Comment 3 Megha Nidhi Dahal CLA 2011-12-10 10:31:09 EST
Created attachment 208216 [details]
Patch file on revision 9 to fix date reading problem

Unable to read Date column. Issue Resolved.
Below are the abservation as per the fix:
1) Date values will now be read from the excel file, no matter what format is used. As long as the type is date, it will be read and displayed as yyyy-MM-dd. Dates can be read as String. Timestamp along with the date cannot be read.
2) Dates in a text column cannot be read as date by excel ODA
3) Time cannot be read. Need some help here. I believe there might be problem with the time parsing.
4) Formulas are getting resolved, even in case of dates.

Please apply attached patch on revision 9, or take an update.
Comment 4 Megha Nidhi Dahal CLA 2011-12-16 00:34:11 EST
Introduced a new dataSet property DATEFORMAT, which can be used to parse dates from text column and also to format date type to be displayed as string type.

Please check out the latest source.
Comment 5 Megha Nidhi Dahal CLA 2012-02-28 11:23:33 EST
Created attachment 211744 [details]
Updated source code attachment

Updated source code.
Comment 6 Megha Nidhi Dahal CLA 2012-02-28 11:23:53 EST
Used different method to read xlsx files pertaining the memory issue with poi. Corrected DateFormat issue introduced because of this fix.

Note: POI and Xerces (new api used for parsing) are still bundled with the project. This has to be created as separate plugin and added as depenencies.

The attachment contains the updated source minus the libs.

Project depends on external projects listed below:
1) Apache POI 3.7
2) Xerces 2.11.0
Comment 7 Megha Nidhi Dahal CLA 2012-03-01 00:27:49 EST
I authored 100% of the content.
I have the rights to contribute the content to Eclipse.
I am contributing the content under the project license EPL.
Comment 8 Jason Weathersby CLA 2012-03-01 09:56:14 EST
Created attachment 211884 [details]
source code

Source code with appropriate comment headers.
Comment 9 Linda Chan CLA 2012-05-30 18:49:58 EDT
Initial contribution has been committed in BIRT Git repo, and included in BIRT 4.2 M7 milestone release.  
Related approved CQs: 6295, 6025, 6374, 6373, 6027, 6026.
Comment 10 Linda Chan CLA 2012-05-30 19:12:24 EDT
One more related approved CQ 6029 
https://dev.eclipse.org/ipzilla/show_bug.cgi?id=6029