Discussion:
about datagrid Response to excel(client)
(时间太久无法回复)
Simon
2006-02-17 06:36:58 UTC
Permalink
œÐ°Ý
Response.ContentType = "application/vnd.ms-excel"
Response.ContentEncoding =
System.Text.Encoding.GetEncoding("big5")
Dim sw As New StringWriter
Dim htw As New HtmlTextWriter(sw)
DataGrid1.RenderControl(htw)
Response.Write(sw.ToString())
DataGrid1€€²Ä€@­ÓÄæŠì¬O­q³æœsž¹®æŠ¡200602010001¶×šìexcel®É·|ÅÜŠš¬ìŸÇ°Ož¹
2.00602E+11¡AœÐ°Ý­nŠpŠóžÑšM?
thanks
unknown
2006-02-17 07:23:27 UTC
Permalink
你把那個欄位資料加一些符號吧~~~
譬如:[200602010001]
我想這樣應該使用者也能接受吧!!

"Simon" 來函:
Post by Simon
請問
Response.ContentType = "application/vnd.ms-excel"
Response.ContentEncoding =
System.Text.Encoding.GetEncoding("big5")
Dim sw As New StringWriter
Dim htw As New HtmlTextWriter(sw)
DataGrid1.RenderControl(htw)
Response.Write(sw.ToString())
DataGrid1中第一個欄位是訂單編號格式200602010001匯到excel時會變成科學記號
2.00602E+11,請問要如何解決?
thanks
Simon
2006-02-17 07:30:52 UTC
Permalink
¥Ø«e§Ú¬O³oŒË°µ¡A¥i¬OšÏ¥ÎªÌ€ñžûÀt€ò¡A€£ªŸŠ³šSŠ³šä¥LªºžÑšM€§¹D¡Atks
ÄŽŠp:[200602010001]
§Ú·Q³oŒËÀ³žÓšÏ¥ÎªÌ€]¯à±µšü§a!!
"Simon" šÓšç¡G
Post by Simon
œÐ°Ý
Response.ContentType = "application/vnd.ms-excel"
Response.ContentEncoding =
System.Text.Encoding.GetEncoding("big5")
Dim sw As New StringWriter
Dim htw As New HtmlTextWriter(sw)
DataGrid1.RenderControl(htw)
Response.Write(sw.ToString())
2.00602E+11¡AœÐ°Ý­nŠpŠóžÑšM?
thanks
璉璉
2006-02-17 07:32:21 UTC
Permalink
œÐšÏ¥ÎŠrŠê«eŸÉ²Åž¹ ' ¡A¿é¥XŠš¡G'200602010001
©ó news:eAX3%23x4MGHA.1192%40TK2MSFTNGP11.phx.gbl µoªí
œÐ°Ý
Response.ContentType = "application/vnd.ms-excel"
Response.ContentEncoding =
System.Text.Encoding.GetEncoding("big5")
Dim sw As New StringWriter
Dim htw As New HtmlTextWriter(sw)
DataGrid1.RenderControl(htw)
Response.Write(sw.ToString())
2.00602E+11¡AœÐ°Ý­nŠpŠóžÑšM?
thanks
--
€ô®ü¬ì§Þšt²Î¬ãµoÅçÃÒ€u§@«Ç ASP.NET Web News Reader 0.2.0 UTF-8 Beta
·s»Džs²Õ RSSºô»xµo¥¬ŽúžÕ€€ http://tlcheng.no-ip.com/News/rss2.aspx
ºô¯žŠa¹Ï http://tlcheng.no-ip.com/wwwmap.htm
¬y°ìšŸ¬x/€ôžê·œ¹B¥Î/®}ª@ºô/ªŽºÀ¹Ï/»y­µ³q°T €å³¹»Pµ{Š¡
Basic/Fortran/Windows API/.Net/»²§U»¡©úÀÉ ­ì©lœX¡B€å³¹»P°Qœ×
--
ASPNET News http://tlcheng.no-ip.com/News/ | http://tlcheng.twbbs.org/News/
RSS 2.0 http://tlcheng.no-ip.com/News/rss2.aspx?Action=List&Newsgroup=microsoft.public.tw.dotnet.framework.aspnet
Li-fan Chen
2006-02-17 07:45:40 UTC
Permalink
Hi Simon,

Use comment or text type. This requires you to use the Excel ODBC Writer or
something like that.

Best regards,
-- Li-fan
Post by Simon
œÐ°Ý
Response.ContentType = "application/vnd.ms-excel"
Response.ContentEncoding =
System.Text.Encoding.GetEncoding("big5")
Dim sw As New StringWriter
Dim htw As New HtmlTextWriter(sw)
DataGrid1.RenderControl(htw)
Response.Write(sw.ToString())
2.00602E+11¡AœÐ°Ý­nŠpŠóžÑšM?
thanks
Len
2006-03-29 13:48:49 UTC
Permalink
§â±zªºDataGrid€åŠrÄæŠì Cell µ¹€@­Ó CssClass šÒŠp: dgText
Šb¶×¥X®ÉŒW¥[:
(¥H€U¬O§Ú¥ÎC#»yªk¥Žªº, " \ " €Ï±×œu¬Ožõ²æŠr€ž)

Response.Write("<style type=\"text/css\">");
Response.Write(".dgText {mso-number-format:\"\\@\";}");
Response.Write("</style>");

-----------------------
§Æ±æ¹ï±zŠ³À°§U
Len
Post by Simon
œÐ°Ý
Response.ContentType = "application/vnd.ms-excel"
Response.ContentEncoding =
System.Text.Encoding.GetEncoding("big5")
Dim sw As New StringWriter
Dim htw As New HtmlTextWriter(sw)
DataGrid1.RenderControl(htw)
Response.Write(sw.ToString())
2.00602E+11¡AœÐ°Ý­nŠpŠóžÑšM?
thanks
继续阅读narkive:
Loading...