|
|
|
.NET สร้าง Excel ด้วย C# และการตกแต่งข้อความ สี อักษร ใน Cell |
|
|
|
|
|
|
|
Code (C#)
xlWorkSheet.Cells[2, 1] = "DataCol 1";
xlWorkSheet.Cells[2, 2] = "DataCol 2";
xlWorkSheet.Cells[2, 3] = "DataCol 3";
xlWorkSheet.Cells[2, 4] = "DataCol 4";
xlWorkSheet.Cells[2, 5] = "DataCol 5";
xlWorkSheet.Cells[2, 6] = "DataCol 6";
xlWorkSheet.Cells[2, 7] = "DataCol 7";
xlWorkSheet.Cells[2, 8] = "DataCol 8";
xlWorkSheet.Cells[2, 9] = "DataCol 9";
xlWorkSheet.get_Range("A3", "I3").Merge(true);
xlWorkSheet.get_Range("A3", "I3").BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
xlWorkSheet.get_Range("A3", "I3").Font.Name = "Tahoma";
xlWorkSheet.get_Range("A3", "I3").Font.Size = "15";
// xlWorkSheet.get_Range("A3", "I3").HorizontalAlignment = 4;
xlWorkSheet.get_Range("A3", "I3").VerticalAlignment = -4108;
xlWorkSheet.get_Range("A3", "I3").HorizontalAlignment = -4108;
xlWorkSheet.get_Range("A3", "I3").Interior.ColorIndex = 44;
xlWorkSheet.get_Range("A3", "I3").Font.ColorIndex = 4;
xlWorkSheet.get_Range("A3", "I3").Font.Italic = true;
xlWorkSheet.Cells[3, 1] = "Hello Hello Hello Hello";
Go to : C# Open Excel and Create Font,Border,Color,Style
|
|
|
|
|
Date :
2011-09-08 20:30:45 |
By :
thaicreate |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|