Hello,
I have a worksheet that has three cells merged together into a single cell, and I’ve placed a SmartMarker into the cell.
The data that gets merged into the merge field has multiple rows. The (mail) merge process works except that on the successive rows, the cells are no longer merged together. My application is not specific to this template, so using Cells to find and merge together the cells programmatically isn’t really feasible.
Any suggestions? It would be great if Cells would handle this situation automatically.
I’ll attach a copy of the template, the output and the simple code I’m using:
protected void Button1_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable(“MyData”);
dt.Columns.Add(new DataColumn(“MyField”));
DataRow dr = dt.NewRow();
dr[“MyField”] = “Alpha”;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[“MyField”] = “Beta”;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[“MyField”] = “Gamma”;
dt.Rows.Add(dr);
WorkbookDesigner designer = new WorkbookDesigner();
designer.Workbook.Open(@“C:\MergedCellsExample.xls”);
designer.SetDataSource(dt);
designer.Process(false);
designer.Workbook.Save(@“C:\Output.xls”, FileFormatType.Default);
}