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?

TM T?T

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).

THNG TIN THM

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"
   %>
   <HTML>
   <BODY>
   <!-- Our table which will be translated into an Excel spreadsheet -->
   <TABLE WIDTH=75% BORDER=1 CELLSPACING=1 CELLPADDING=1>
   <TR>
      <TD>Book ID</TD>
      <TD>Book Title</TD>
      <TD>Price</TD>
      <TD>Shipping Fee</TD>
      <TD>Tax Rate</TD>
      <TD>Total Cost</TD>
   </TR>
   <TR>
      <TD>="0001"</TD>
      <TD>The Perfect Programming Book</TD>
      <TD>13.00</TD>
      <TD>5.00</TD>
      <TD>8.25%</TD>
      <TD>=Sum(c2:d2)*(1+E2)</TD>
   </TR>
   </TABLE>
   </BODY>
   </HTML>
				

THAM KH?O

? 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