Hi,
I have an application where the user can create a template XLS file and then the application reads the template into a Workbook.
The code then writes data values into the first worksheet abd writes the resultant spreadsheet out to disk. This all works fine so long as the template does not have merged cells. If I try to write a data value to a merged cell there are no errors but when I look at the cell in the resultant spreadsheet it is blank.
It is possible to set the value of a merged cell and have it saved in the export?
Which version of the Excel library are you using? Is it possible to provide a small sample which demonstrates the issue?
I'm using 11.1. I had this problem before and had forgotten that I had asked the question previously also. The answer is that you have to set the value on the grouped cells as in...
if (worksheet.Rows[row].Cells[column].AssociatedMergedCellsRegion == null){ worksheet.Rows[row].Cells[column].Value = value;}else{ WorksheetMergedCellsRegion mcr = worksheet.Rows[row].Cells[column].AssociatedMergedCellsRegion; mvr.Value = value;}
Just in case anyone else has the same problem.
Hello ,
Thank you for your post. As far as I understand you were able to solve your issue.
Please do not hesitate to contact with us if you have any further questions.
Thank you for using Infragistics Components.