导出Excel类源码

最近整理了一个导出Excel的类,感觉挺好使的! 现在共享出来希望高手大哥们能帮助完善一下!
类文件: Export_Excel
调用方法:

        AppDTO2.Export_Excel ExportExcel = new AppDTO2.Export_Excel();
        ExportExcel._StartCount = 1;
        if (rbtAll.Checked)
        {
            ExportExcel._DT = GridViewDataSource;
        }
        else
        {
            ExportExcel._GridView = GridView1;
        }

        ExportExcel._HeaderText = "个人考试情况统计";
        ExportExcel._FileName = "个人考试情况统计表";
        ArrayList aList = new ArrayList();
        aList.Add(AppDTO2.HtmlTableCellx.AddItem("试卷名称", "center", "", "20%", "", ""));
        aList.Add(AppDTO2.HtmlTableCellx.AddItem("有效时间", "center", "", "20%", "", ""));
        aList.Add(AppDTO2.HtmlTableCellx.AddItem("考试次数", "center", "", "20%", "", ""));
        aList.Add(AppDTO2.HtmlTableCellx.AddItem("未评次数", "center", "", "20%", "", ""));

        Response.Write(ExportExcel.ExportToExcel(this, aList));
        Response.End();



你可能感兴趣的:(导出Excel)