开发者

Merge down two cells in a column using CarlosAg ExcelXMLWriter

I am using CarlosAg ExcelXMLWriter. I am able to use some of the features as shown in the sample provided in the site. But I am unable to merge two or more cells in a column. Following works:

WorksheetCell cell = row.C开发者_Python百科ells.Add("Header 3");
cell.MergeAcross = 1;            // Merge two cells together
cell.StyleID = "HeaderStyle";

But this does not:

WorksheetCell cell = row.Cells.Add("Header 3");
cell.MergeDown = 2;            // Merge two cells together down
cell.StyleID = "HeaderStyle";

Has anyone experienced the same? Help Please. Thanks.


At first, I also encountered the same issue which took me time analyze and research. What I did was, change this line first to

cell.MergeDown = 1;

run and extract the file. Once successful, try to put it back to

cell.MergeDown = 2;

This worked fine for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜