Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JXL insert text into empty cell (change cell type)  RSS feed

 
maik miorandi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I am using jxl to modify existing excel files, but i stumbled across a problem


I read the file and get my WritableSheet named "foglio", then i get my cell as following:


If the cell has a "Label" cell type, i can write in it using this:

But if the cell has an "Empty" cell type, i cannot write in it (i get a "java.lang.ClassCastException: jxl.write.Blank cannot be cast to jxl.write.Label")

So how can i change the cell type? The Cell class has no setType method or similar...

Any idea about it?
Thanks in advance
 
Tony Docherty
Bartender
Posts: 3264
81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never used JXL so can't answer this for sure but my guess would be that you have to add a writeable cell to the WritableSheet at the location of the blank cell you are trying to edit. I'd check out the API docs and see if there is a setCell or addCell type method in the WritableSheet class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!