• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
suchit pandya
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!!!
reply
    Bookmark Topic Watch Topic
  • New Topic