Excel样式
Excel的格式都是要对一定的范围进行设置的,首先得到范围:
Microsoft.Office.Interop.Excel.Range range = xlSheet.get_Range("A1", "B3");
Microsoft.Office.Interop.Excel.Range range = xlSheet.get_Range("A1", "B3");
range.MergeCells = true; //合并单元格
range.RowHeight = 40; //设置标题行高
range.Font.Size = 20; //设置标题字体
range.Font.Bold = true; //设置标题为粗体
range.ColumnWidth = 40; // 设置列宽
range.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;//居中
range.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter; // 垂直显示在中间range.set_Value(miss, text); // 设置值