private void CreateExcel()
{

Excel.ApplicationClass ExcelApp=new Excel.ApplicationClass();
ExcelApp.Visible=false;
            Excel.Workbook ExcelWork=ExcelApp.Workbooks.Add(true);
Excel.Worksheet ExcelSheet=(Excel.Worksheet)ExcelWork.Worksheets[1];
Excel.Range range=ExcelSheet.get_Range("B2","F2");
range.Merge(0);
range.HorizontalAlignment=Excel.XlVAlign.xlVAlignCenter;
range.Font.Size=10;
ExcelSheet.Cells[2,2]="数据测试";
            int R=3;
for(int i=0;i<=ds.Tables[0].Columns.Count-1;i++)
{
ExcelSheet.get_Range(ExcelSheet.Cells[R,i+2],ExcelSheet.Cells[R,i+2]).Borders.LineStyle=1;
ExcelSheet.get_Range(ExcelSheet.Cells[R,i+2],ExcelSheet.Cells[R,i+2]).Font.Size=10;
                ExcelSheet.get_Range(ExcelSheet.Cells[R,i+2],ExcelSheet.Cells[R,i+2]).ColumnWidth=14;
ExcelSheet.get_Range(ExcelSheet.Cells[R,i+2],ExcelSheet.Cells[R,i+2]).HorizontalAlignment=Excel.XlVAlign.xlVAlignCenter;
ExcelSheet.Cells[R,i+2]=ds.Tables[0].Columns[i].ColumnName;
}
R++;
for(int j=0;j<=ds.Tables[0].Rows.Count-1;j++)
{
for(int i=0;i<=ds.Tables[0].Columns.Count-1;i++)
{
ExcelSheet.get_Range(ExcelSheet.Cells[R,i+2],ExcelSheet.Cells[R,i+2]).Borders.LineStyle=1;
ExcelSheet.get_Range(ExcelSheet.Cells[R,i+2],ExcelSheet.Cells[R,i+2]).Font.Size=10;
ExcelSheet.get_Range(ExcelSheet.Cells[R,i+2],ExcelSheet.Cells[R,i+2]).ColumnWidth=14;
ExcelSheet.get_Range(ExcelSheet.Cells[R,i+2],ExcelSheet.Cells[R,i+2]).HorizontalAlignment=Excel.XlVAlign.xlVAlignCenter;
                    ExcelSheet.Cells[R,i+2]=ds.Tables[0].Rows[j][i];
}
R++;
}
ExcelApp.ActiveWorkbook.SaveAs("c:\\review.htm",Excel.XlFileFormat.xlHtml,null,null,null,
null,Excel.XlSaveAsAccessMode.xlNoChange,null,null,null,null,null);
ExcelApp.Quit();
}