Lm th? no ? ?nh d?ng d? li?u di ?ng khi b?n ang t?o m?t File Excel v?i m?t my ch? ho?t ?ng trang trang

D?ch tiu ? D?ch tiu ?
ID c?a bi: 260239 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?


Bi vi?t ny ch?ng t? lm th? no ? ?nh d?ng m?t l?nh v?c ? b?o t?n cc ch? s? hng ?u (nh cc "000" trong "0001112") hay m?t cng th?c c? th? khi b?n t?o m?t file Excel v?i m?t trang Active Server Pages (ASP).


N?u b?n thi?t l?p cc
Response.ContentType = "application/vnd.ms-excel"
trong m?t trang ASP, Excel s? ?c a ra ? x? l? cc ti li?u v hi?n th? n nh m?t b?ng tnh Excel. ? bi?t thm chi ti?t, b?m vo s? bi vi?t d?i y ? xem bi vi?t trong c s? ki?n th?c Microsoft:
199841 Lm th? no ? hi?n th? ASP k?t qu? b?ng cch s? d?ng Excel trong IE v?i MIME Types
N?u l?nh v?c bn c m?t s? khng hng ?u, sau chi?c zero (ho?c Zero) s? b? t?c b? v? Excel x? l? cc l?nh v?c nh m?t gi tr? s?.

B?n c th? ch? ?nh cc t? bo nh l m?t chu?i gi tr? ? b?o t?n cc ?nh d?ng trong trang ASP. B?n th?m ch c th? ch? ?nh cng th?c ? tnh ton trong m? c?a b?n.

Trang sau y, Test.asp, ch?ng t? lm th? no b?n c th? lm i?u ny:
<%@ Language=VBScript %>
      'Change HTML header to specify Excel's MIME content type
      Response.Buffer = TRUE
      Response.ContentType = "application/vnd.ms-excel"
   <!-- Our table which will be translated into an Excel spreadsheet -->
      <TD>Book ID</TD>
      <TD>Book Title</TD>
      <TD>Shipping Fee</TD>
      <TD>Tax Rate</TD>
      <TD>Total Cost</TD>
      <TD>The Perfect Programming Book</TD>


? bi?t thm chi ti?t, b?m vo s? bi vi?t d?i y ? xem bi vi?t trong c s? ki?n th?c Microsoft:
247318 L?I: Word 2000 v Excel 2000 khng chuy?n h?ng chnh xc khi s? d?ng Response.Redirect
264143 Kh?c ph?c: ASP phin bi?n r?ng khi Office 2000 MIME lo?i ?c xem tr?c ti?p v?i Internet Explorer

Thu?c tnh

ID c?a bi: 260239 - L?n xem xt sau cng: 22 Thang Chin 2011 - Xem xt l?i: 3.0
p d?ng
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Internet Explorer 4.01 Service Pack 1
  • Microsoft Excel 97 Standard Edition
T? kha:
kbhowto kbscript kbmt KB260239 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:260239

Cung cp Phan hi


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com