Hi Mike,
Well, I think you may create your own code to get the merged cells using Cells.MergedCells API and can merge all the data cells in a column after processing the smart markers.
May the following sample code help you for your need, I think you may consult it and try to create your own for your template files.
e.g..,
Sample code:
designer.Process(false);
Cells cells = designer.Workbook.Worksheets[0].Cells;
ArrayList al = new ArrayList();
al = cells.MergedCells;
CellArea ca;
int frow, fcol, erow, ecol, trows, tcols;
for (int i = 0; i < al.Count; i++)
{
ca = new CellArea();
ca = (CellArea)al[i];
frow = ca.StartRow;
fcol = ca.StartColumn;
erow = ca.EndRow;
ecol = ca.EndColumn;
trows = erow - frow + 1;
tcols = ecol - fcol + 1;
for (int j = frow; j <= cells.MaxDataRowInColumn(fcol); j++)
{
cells.Merge(j, fcol, trows, tcols);
}
}
designer.Workbook.Save(@"f:\test\new_Output_MergedCellsExample5.xls", FileFormatType.Default);
And we will check if we can consider this feature (automatically merging cells after processing the smart markers) after completing some of the important tasks on hand.
Thanks for your time and understanding.
Amjad Sahi
Support Developer,
Aspose Nanjing Team
Contact Us