asp.net导出EXCEL问题! - .NET技术 / ASP.NET
C# code:
SqlConnection conn = CsDB.sqlcon();
SqlDataAdapter da = new SqlDataAdapter("select fwCoding from bjmuma_fwCoding where OrderNumber='" + Order + "'", conn);
DataSet ds = new DataSet();
da.Fill(ds, "table1");
DataTable dt = ds.Tables["table1"];
StringWriter sw = new StringWriter();
sw.WriteLine("test", "vnd.ms-excel.numberformat:@");
foreach (DataRow dr in dt.Rows)
{
sw.WriteLine(dr["fwCoding"]);
}
//string execlname = CsDB.GetSear(Coding);
sw.Close();
// foreach (DataGridItem dg in this.DataGrid1.Items) { dg.Cells[列].Attributes.Add("style", "vnd.ms-excel.numberformat: @;"); } this.DataGrid1.RenderControl(hw);
//DateTime.Now.ToString("yyyyMMdd_hhmm")
Response.AddHeader("Content-Disposition", "attachment; filename=" + CsDB.GetSear(Order) + ".csv");
Response.ContentType = "application/ms-excel";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Respons
相关问答:
owc11满足不了要求,有没有更好点的,asp能调用的
目前没发现,帮你顶!
应该没有了吧
自已写。顶
帮顶,关注!
好像就这个了,目前还没看到其他得上市使用。。。帮顶!
自己再顶一下
好像是没有 ......
http://www.zgjhjy.com/Test/PrimaryTest/Index.aspx
就是类似以上的在线测试系统,需要有一个后台的,语言是asp的,数据库是access的,还需要能在后台对信息进行添删改查的。谢谢各位了。。。
程序真的很多,不知 ......
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
Namespace CBDAspNet.WebControls.HTML
''' <summary>
'' ......
function CheckOpwd(){//验证用户名
var pwd=document.all.txtOpwd;
var div1=document.getElementById("divPwd");
if (pwd.value=="")
{
......
调整了这里,那里出问题。
有没有什么好的方法,像调整对话框一样????
找个专门做页面的
在dreamweaver里调。。。也可以直接控制HTML代码
确实痛苦 感同身受呀
哈哈 坚决路过。
用DW吧,VS搞设计 ......