aspose file tools*
The moose likes XML and Related Technologies and the fly likes want to get more then 256 columns in XL using JXL API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "want to get more then 256 columns in XL using JXL API" Watch "want to get more then 256 columns in XL using JXL API" New topic
Author

want to get more then 256 columns in XL using JXL API

suchit pandya
Ranch Hand

Joined: Oct 27, 2009
Posts: 43
Hi,

I have an application where we export data to an excel sheet and we are using JExcel API for it. We have more than 256 columns and I get warnings saying
" Could not add cell at A257 because it exceeds the maximum column limit" after adding the contects to the 256th column.
I did some research but could not get much information on this. According to my research, Excel2003 has column limit of 256. I tried installing excel2007, still it gives the same warnings.
Does JExcel supports Excel2007? Is there anyway to overcome this issue? Please do suggest me something. Thanks a lot in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
Libraries like Apache POI and jExcelApi do not support particular versions of Excel, they support particular Excel file formats. POI understands both the old XLS and the new XLSX formats, while jExcelApi only deals with XLS.

It is XLS that has the 256 column limitation; if you need more then you'll have to resort to XLSX and Apache POI. You won't be able to open those files with older Excel versions, though.

Maybe the solution is not to add more columns, but to add more sheets?


Ping & DNS - my free Android networking tools app
suchit pandya
Ranch Hand

Joined: Oct 27, 2009
Posts: 43
Thanks Ulf Dittmer for replying.

Can't we use XLSX with JXL API?

And at client side they have installed converters from xlsx to xls so will they be able to open documents in office 2003 if columns are greater then 256?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

If Excel 2003 can't handle more than 255 columns, then it can't handle more than 255 columns no matter where the document comes from and no matter what machinations you use to produce it.
suchit pandya
Ranch Hand

Joined: Oct 27, 2009
Posts: 43
Ok.

how can we create more then one excel as Ulf Dittmer told?

and for apache POI will it support xls by converter? Will it display data upto 256th column in xls?

Or it needs office 2007 compulsory? Is there any other solution which can support both?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
how can we create more then one excel?

Assuming that by "more than one excel" you mean you want to create an XLS file with more than one sheet, org.apache.poi.ss.usermodel.Workbook has methods for adding sheets to an existing workbook. You may want to work through the examples in http://poi.apache.org/spreadsheet/quick-guide.html to get a feel for the API.

and for apache POI will it support xls by converter? Will it display data upto 256th column in xls?

POI does not display anything, not does it know anything about any converters. It merely reads and writes files.

Or it needs office 2007 compulsory? Is there any other solution which can support both?

Office 2003 can work with XLS files, and Office 2007 can work with both XLS and XLSX files. POI itself does not need any version of Excel to be installed to do its work.
suchit pandya
Ranch Hand

Joined: Oct 27, 2009
Posts: 43
Yes i can understand that POI doesn't need any version of MS-Office . its work is to read and writes files.

But at client side they can open office 2007 decuments in office 2003(using converters). Now i give them the solution of column limitation by using apache POI then file with more then 256 column(or what are the column numbers). but when user opens this document created by POI then i think it will not open. I was asking this to you to conform this.

So better option is to give them report in two sheets.

And thanks For the solution.
suchit pandya
Ranch Hand

Joined: Oct 27, 2009
Posts: 43
Hey Thanks Ulf Dittmer and Paul Clapham. I solved it by generating more then one sheet in Excel.

This was an urgent issue and i was not knowing anything about API and Ulf Dittmer's suggestions saved a lot of time.
Thanks For replying again!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: want to get more then 256 columns in XL using JXL API