普通导出
来源:互联网 发布:阿里面试算法题 编辑:程序博客网 时间:2024/06/10 00:15
#region 导出EXCEL类
public void toExcel(GridView grdTemp)
{
grdTemp.AllowPaging = false; //设置不能分页
grdTemp.AllowSorting = false;
DataTable table = bindDate();
grdTemp.DataSource = table; //重新绑定数据源
grdTemp.GridLines = GridLines.Both;
grdTemp.DataBind();
//常规导出方法
System.IO.StringWriter SW = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter HTW = new System.Web.UI.HtmlTextWriter(SW);
grdTemp.RenderControl(HTW);
//Page为要导出的对象,当前是Page,如果是DataGrid,DataList等都可以
Response.Buffer = true;
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application nd.ms-excel";
string str_day = System.DateTime.Now.ToShortDateString().ToString().Trim();
//string fileName = "超期数据";
Response.Charset = "gb2312";
// Response.Charset = "Unicode";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.AddHeader("Content-Disposition", "attachment;filename=" + str_day + ".xls");
Response.Write(SW.ToString());
Response.Flush();
Response.Close();
}
#endregion
//GridView中引发异常,需重载此方法
public override void VerifyRenderingInServerForm(Control control)
{
}
- 普通导出
- 普通导出错误 EXP-00056
- 普通dll导出c++类
- 从普通dll导出lib
- 从普通DLL中导出C++类
- 引用jar包导出excel(普通)
- ASP.net(C#)导出Excel----普通表头,多层表头。
- python实现数据导出到excel--普通格式
- 普通
- 普通
- 通过XFire导出器XFireExporter来讲普通的业务类导出为web services 服务
- Balon白话MSDN:从普通DLL中导出C++类(2) – 细看导出C++类的底层机制
- Balon白话MSDN:从普通DLL中导出C++类(2) – 细看导出C++类的底层机制
- 从普通DLL中导出C++类(2) – 细看导出C++类的底层机制
- 白话MSDN:从普通DLL中导出C++类(2) – 细看导出C++类的底
- 使用导出导入(datapump)方式将普通表切换为分区表
- Oracle数据库分别在Windows/Linux环境下普通/数据泵方式导入/导出示例
- 从普通DLL中导出C++类 – dllexport和dllimport的使用方法
- JSTL与Struts的结合(一)
- JSTL与Struts的结合(二)
- 用户成就软件
- JIRA的安装,破解和sql server数据库配置
- JSTL与Struts的结合(三)
- 普通导出
- 最近
- 经典逗女孩子的暴笑短信
- 存储过程定时执行
- 2008年最具投资价值的中国25家上市公司评选
- 两个大整数的乘积(可超过100位)C# edition
- java中hashcode()和equals()的详解
- Daily Cleaning background Jobs
- 分页程序的总结