excel| data I recently made a project, the requirements of the project is to the ASP page in the library of the data extracted directly into the form of Excel, just at the beginning of my thinking for the good to finally do it out, here and everyone to share!!
---------------------------------------
The script is as follows: <%
Dim rs_code,sql_code,rs_date,sql_date
If Request ("Op") = "Show" Then
Sborder= "0"
sbg1= "Bgcolor=black"
Sbg2= "Bgcolor=white"
Else
Sborder= "1"
Sbg1= ""
Sbg2= ""
If Request ("Op") = "Excel" Then
Response.ContentType = "Application/msexcel"
Response.AddHeader "Content-disposition", "inline"; Filename=1.xls "
ElseIf Request ("Op") = "DownLoad" Then
Response.ContentType = "Application/msexcel"
Filename= "(" &request ("Syear") & "-" &request ("Smonth") & ") ********** (here for the program name you want to do, define for yourself)"
Response.AddHeader "Content-disposition", "attachment"; Filename= "&FileName&". xls "
End If
End If
%>
The page must be routed to the top of the page: parameters: Like qh_tj_c_imbark.asp? Op=show
--------------------------------------------
You must add the following sections in the program you want to convert to Excel output:
<table width= "875" border=<%=sborder%> cellspacing= "1" cellpadding= "1" align= "center" <%=sbg1%>>
---------------------------------------------
<tr <%=sbg2%>>
---------------------------------------------
After you've done your job, you can write the program you want to do.