日期:2014-05-18  浏览次数:20642 次

导出问题
如果没有安装office   能不能导出Exsel呢?有没有什么方法或代码可以实现?
急着用啊.
谢谢!!

------解决方案--------------------
protected void Button1_Click(object sender, EventArgs e)
{
string aa = "a,b,c,d,\re,f,g,\ryyyy ";
Response.AppendHeader( "Content-Disposition ", "attachment;filename= " + "aa.xls ");
Response.Charset = "UTF-8 ";
Response.ContentType = "application/ms-excel ";
StringWriter sw = new StringWriter();
try
{
sw.Write(aa);
}
catch
{

}
finally
{
Response.Write(sw);
sw.Close();
Response.End();
}

}
------解决方案--------------------
CarlosAg.ExcelXmlWriter实现.net下Excel导出功能(服务端不需要安装Excel程序)
(原文地址http://blog.csdn.net/yicel/archive/2007/04/16/1566577.aspx)
CarlosAg.ExcelXmlWriter是一三方dll控件,可以到http://www.carlosag.net/Tools/ExcelXmlWriter/Default.aspx下载。他使用起来非常简单。在C#中使用方法: