File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes Apache POI HSSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Apache POI HSSF" Watch "Apache POI HSSF" New topic
Author

Apache POI HSSF

jasdeep parmar
Greenhorn

Joined: Oct 06, 2008
Posts: 20
Hi,

I am trying to write some data to Excel worksheet using Apache POI HSSF
I am doing whole lot of to formatting this data before writing. The excel sheet gets generated and opens up fine if the number of rows are less than 400 but if it exceeds more that that i get "Too many different cell formats" error while opening it and removes all the formatting in rest of the rows. Does anybody know what could be causing that. The same formatting works up un till count of rows less than 400.
I am using poi-3.1-FINAL-20080629.jar which is there in original software won't let me use newer version.

Please help...
thanks
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Sounds like a difficult problem. I don't know POI but have a couple of suggestions:

1.) Can you merge sheets of <400 together? E.g. create sub sheets and merge afterward avoiding the >400 error.

2.) Does putting in a newer version fix the problem? I know you're not allowed to but if the newer version fixes it, then you can look at the source code and patch your version with the fix.

Hope that helps a little


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
jasdeep parmar
Greenhorn

Joined: Oct 06, 2008
Posts: 20
Thanks for the reply...

I wasn't able to apply the newer version. I still am not sure how to fix it and I did find out that if i open the file in Excel 2007 it opens fine. I'm doing lot for formatting but its not like every cell in those 400 rows has different formatting so I still dont understand the root cause in code.

we did found a work around (run files for smaller data set :-) )
I just wanted to thank you for your time..
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

No worries and I'm glad you found a workaround!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Apache POI HSSF