Read data from merged cells
Posted: Sun Jun 24, 2007 3:02 pm
Does XLSReadWriteII handles the case of reading merged cells?
Because now it seems that when reading an excel file which contains merged cells, it associates the read data on the first cell, and the rest of the merged cells are considered to be empty.
For example here is a small code where I read the contents of an excel file and populate a Grid component with the cells value:
The result is that each cell of the grid component gets the corresponding value from the excel file. BUT the merged cells of the excel file are not imported as merged and therefore the value of the merged cells only goes to the first one of the merged cells. The remain cells are just kept blank.
Any ideas how to solve this?
[/img]
Because now it seems that when reading an excel file which contains merged cells, it associates the read data on the first cell, and the rest of the merged cells are considered to be empty.
For example here is a small code where I read the contents of an excel file and populate a Grid component with the cells value:
Code: Select all
for row:=0 to MAX_ROWS do
begin
Grid.AddRow();
for col:=0 to MAX_COLUMNS do
begin
data_str:=XLS.Sheet[SheetIndex].AsString[col,row];
Grid.Cell[col,row].AsString:=data_str;
end;
end;
Any ideas how to solve this?
[/img]