'' 定义对象
oExcel = New Excel.Application
'' 选择所有
oExcel.Cells.Select()
'' 设置为文本
oExcel.Selection.NumberFormatLocal = "@" -----这个是你想要的
'' Cell 1获得焦点
oExcel.Range("A1").Select()给分吧。哈哈哈哈……
oExcel = New Excel.Application
'' 选择所有
oExcel.Cells.Select()
'' 设置为文本
oExcel.Selection.NumberFormatLocal = "@" -----这个是你想要的
'' Cell 1获得焦点
oExcel.Range("A1").Select()给分吧。哈哈哈哈……
解决方案 »
- 怎么样转载和分享文章到QQ空间???
- 项目文件删除恢复问题……大侠,高手都快进,急等
- 在aspx文件中,这个表达式要怎么写呢?
- 如何写一个验证码?
- 为什么我绑定完Repeater后,他Item.DataItem为空???
- |M| 从零开始学习存储过程第七贴:在SQL查询分析器里面调试存储过程出错
- 我想从服务器向客户端一次性推送多个文件,请问应该怎么做?
- 从数据库读取数据制作饼状图和柱状图,怎么做?
- 用过HtmlEditor的大哥大姐们求你们进来一下,好吗?
- 得到当前单击datagrid的行号?????
- Infragistics.WebUI.WebDataInput.WebDateTimeEdit怎樣用,幫忙看看?
- 如何合并TextBox和DropDownList?
000(前面的)去掉。
Response.Charset = "UTF-8";
Response.ContentType = "application/vnd.ms-excel"; this.EnableViewState = false; System.IO.StringWriter tw= new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw=new System.Web.UI.HtmlTextWriter(tw);
DataGrid1.RenderControl(hw); Response.Write(tw.ToString());
;
Response.End();这种方式导出的怎么控制字段的类型啊?