How to extract data to Microsoft Excel Sheet from database
1.Declaration MX.Application xl = null; MX.Workbook wb = null; MX.Worksheet wsheet = null; xl = new MX.Application(); wb = Microsoft.Office.Interop.Excel.Workbook)(xl.Workbooks.Add(Missing.Value)); wb.Sheets.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value); wsheet = (Microsoft.Office.Interop.Excel.Worksheet)(wb.Sheets[1]); wsheet.Cells.Font.Name = “VERDANA”; wsheet.Cells.Font.Size = 9; wsheet.Cells.HorizontalAlignment = MX.XlHAlign.xlHAlignCenter; wsheet.get_Range(“A1”, “A1”).ColumnWidth = 9; wsheet.get_Range(“B1”, “B1”).ColumnWidth = 13; wsheet.get_Range(“C1”, “C1”).ColumnWidth = 28; wsheet.get_Range(“D1”, “D1”).ColumnWidth = 12; wsheet.Cells[4, 1]… Read More »