Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jxl - problem with merging cells in excel file.

 
Chaitanya ekre
Greenhorn
Posts: 12
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
i am using jxl to create excel sheet and writing data into it. Now my problem is when i merge cells in excel sheet the data contained in the those sheet do not get displayed into merged cell.
so is it possible to merge cells without loosing data in all cells ??
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
I shall move this question as it is too difficult for “beginning”.
 
Chaitanya ekre
Greenhorn
Posts: 12
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Campbell Ritchie - okay !! Thanks
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cekre ekre wrote:so is it possible to merge cells without loosing data in all cells ??

As far as I know, no. You can even try with Excel - put two different values into A1 and B1 and merge them - Excel will warn you that it will keep only the data of the upper-left cell.

Edit: if you want to display the concatenated contents of the individual cells in the merged cell, you'll need to create the merged value, put that into the upper-left corner and then merge.
 
Chaitanya ekre
Greenhorn
Posts: 12
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to print this string -- "exprName 14 : 5 : 0 " in a single cell. i want all the numbers to be in a different colors.
first i have tried to make a single label with different colors and add it to single cell. but i could not do it.
so i tried a new way to split the string in different cells with differnt colored labels and then merge these cells but after mergeing cells the merged cell contains only the top left cell value.
so i am stuck with this. so is there can anyone suggest me new solution ??

@Martin Vajsar : Thank you !! the MS excel do not allow to display hidden cell values into merged cell but Open Office Calc provides this functionality.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just tried to create a cell manually in Excel (the application) which contains letters of different colors. That is possible, and of course it is possible for merged cells too.

I have no idea whether JExcelApi supports that, though. The API would have to provide some methods to manipulate formats of individual characters in a cell. (A cursory look at the javadoc gave me an impression this is not supported, but I may be wrong.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic