通过如下代码合并列头
this.mainSpread.Sheets[0].ColumnHeader.RowCount = 2;
// Span the header cells as needed.
this.mainSpread.Sheets[0].ColumnHeaderSpanModel.Add(0, 0, 1, 6);
this.mainSpread.Sheets[0].ColumnHeaderSpanModel.Add(0, 6, 1, 5);
this.mainSpread.Sheets[0].ColumnHeaderSpanModel.Add(0, 11, 1, 3);
this.mainSpread.Sheets[0].ColumnHeaderSpanModel.Add(0, 14, 1, 4);
// Set the labels as needed --
// using the Label property or the cell Text property.
this.mainSpread.Sheets[0].ColumnHeader.Cells[0, 0].Text = "工程基本情况";
this.mainSpread.Sheets[0].ColumnHeader.Cells[1, 0].Text = "部门";
this.mainSpread.Sheets[0].ColumnHeader.Cells[1, 1].Text = "项目名称";
this.mainSpread.Sheets[0].ColumnHeader.Cells[1, 2].Text = "合同金额";
this.mainSpread.Sheets[0].ColumnHeader.Cells[1, 3].Text = "增减";
this.mainSpread.Sheets[0].ColumnHeader.Cells[1, 4].Text = "预计总收入";
this.mainSpread.Sheets[0].ColumnHeader.Cells[1, 5].Text = "预计毛利率";
可第二行的列头显示不对,有解决方法吗,明细感觉多了一个分割线
|
|