做个备忘
public void DataTabletoExcel(System.Data.DataTable headTable, System.Data.DataTable contentTable, string strFileName)
{
if (headTable == null || contentTable == null) return;
int rowIndex = 1;
int columnIndex = 0;
Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.ApplicationClass();
xlApp.DefaultFilePath = "";
xlApp.DisplayAlerts = true;
xlApp.SheetsInNewWorkbook = 1;
Workbook xlBook = xlApp.Workbooks.Add(true);
xlBook = oneTableToExcel(xlBook, headTable, columnIndex, rowIndex, xlApp);
rowIndex = 4;
xlBook = oneTableToExcel(xlBook, contentTable, columnIndex, rowIndex, xlApp);
//
string ExcelOutP