aspose file tools*
The moose likes General Computing and the fly likes jxl - problem with merging cells in excel file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "jxl - problem with merging cells in excel file." Watch "jxl - problem with merging cells in excel file." New topic
Author

jxl - problem with merging cells in excel file.

Chaitanya ekre
Greenhorn

Joined: Jan 02, 2013
Posts: 12

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

Joined: Oct 13, 2005
Posts: 36555
    
  16
Welcome to the Ranch
I shall move this question as it is too difficult for “beginning”.
Chaitanya ekre
Greenhorn

Joined: Jan 02, 2013
Posts: 12

@ Campbell Ritchie - okay !! Thanks
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3445
    
  47

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

Joined: Jan 02, 2013
Posts: 12

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

Joined: Aug 22, 2010
Posts: 3445
    
  47

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.)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jxl - problem with merging cells in excel file.
 
Similar Threads
Upload Data in Excel file
how to retrive data database to xlsheet
Does jxl support graphs / charts
Using JDBC to insert into MS Excel file
Grouping in MS-Excel