Sunday, 15 February 2015

What is the better API to Reading Excel sheets in java - JXL or Apache POI -



What is the better API to Reading Excel sheets in java - JXL or Apache POI -

which of 2 apis simpler read/write/edit excel sheets ? these apis not back upwards csv extensions ?

using jxl file.xls , file.xlsx, exception like:

class="lang-none prettyprint-override">jxl.read.biff.biffexception: unable recognize ole stream @ jxl.read.biff.compoundfile.<init>(compoundfile.java:116) @ jxl.read.biff.file.<init>(file.java:127) @ jxl.workbook.getworkbook(workbook.java:268) @ core.readxlsheet.contentreading(readxlsheet.java:46) @ core.readxlsheet.init(readxlsheet.java:22) @ core.readxlsheet.main(readxlsheet.java:72)

both .xls , .xlsx extensions. java version using : jdk1.6

i have used both jxl (now "jexcel") , apache poi. @ first used jxl, utilize apache poi.

first, here things both apis have same end functionality:

both free cell styling: alignment, backgrounds (colors , patterns), borders (types , colors), font back upwards (font names, colors, size, bold, italic, strikeout, underline) formulas hyperlinks merged cell regions size of rows , columns data formatting: numbers , dates text wrapping within cells freeze panes header/footer support read/write existing , new spreadsheets both effort maintain existing objects in spreadsheets read in intact far possible.

however, there many differences:

perhaps important difference java jxl not back upwards excel 2007+ ".xlsx" format; supports old biff (binary) ".xls" format. apache poi supports both mutual design. additionally, java portion of jxl api lastly updated in 2009 (3 years, 4 months ago write this), although looks there c# api. apache poi actively maintained. jxl doesn't back upwards conditional formatting, apache poi does, although not significant, because can conditionally format cells own code. jxl doesn't back upwards rich text formatting, i.e. different formatting within text string; apache poi back upwards it. jxl supports text rotations: horizontal/vertical, +/- 45 degrees, , stacked; apache poi supports integer number of degrees plus stacked. jxl doesn't back upwards drawing shapes; apache poi does. jxl supports page setup settings such landscape/portrait, margins, paper size, , zoom. apache poi supports of plus repeating rows , columns. jxl doesn't back upwards split panes; apache poi does. jxl doesn't back upwards chart creation or manipulation; back upwards isn't there yet in apache poi, api starting form. apache poi has more extensive set of documentation , examples available jxl.

additionally, poi contains not main "usermodel" api, event-based api if want read spreadsheet content.

in conclusion, because of improve documentation, more features, active development, , excel 2007+ format support, utilize apache poi.

java excel apache-poi jxl

No comments:

Post a Comment