level 1
331905073
楼主
<%
rs.close
set rs=nothing
excel.Close
Set excel=Nothing
set objExcelApp = CreateObject("Excel.Application")
objExcelApp.DisplayAlerts = false
objExcelApp.Application.Visible = false
strAddr = Server.MapPath(".")
objExcelApp.WorkBooks.Open(strAddr & "\Database\"&filename)
set objExcelBook = objExcelApp.ActiveWorkBook
'set objExcelSheets = objExcelBook.Worksheets
set objExcelSheet = objExcelBook.Sheets("Sheet1")
%>
<%for k=1 to filebths%>
<tr bgcolor="#C0D8F1" class="xsz">
<%
for j=1 to filebtls
temp=objExcelSheet.Cells(k,j).Value
temp1=objExcelSheet.Cells(k,j).mergecells
if temp1 then
ttemp =objExcelSheet.Cells(k,j).MergeArea.cells(1,1).address
tttemp=objExcelSheet.Cells(k,j).address
if ttemp = tttemp then
m=objExcelSheet.Cells(k,j).MergeArea.Columns.Count
n=objExcelSheet.Cells(k,j).MergeArea.rows.count
if trim(temp) ="" then temp=" "
stri="<td align='center' valign='middle' "
if m>1 then stri=stri&"colspan='"&m&"' "
if n>1 then stri=stri&"rowspan='"&n&"' "
stri=stri&">"&temp&"</td>"
Response.Write(stri)
end if
else
if trim(temp)= "" then
response.Write("<td> </td>")
else
response.Write("<td>"&temp&"</td>")
end if
end if
next
%>
</tr>
<%next%>
<%
objExcelApp.Quit
set objExcelApp = Nothing
%>
<%
strAddr = Server.MapPath(".\Dat\"&filename)
set excel=server.createobject("adodb.connection")
%><!--#include file="excel_ts.asp"--><%
set rs=server.CreateObject("adodb.recordset")
rs.open Sql,excel
%>
<% do %>
<tr>
<%
For j=0 To filebtls-1
curValue = rs.Fields(j).Value
if curValue<>"" then
Response.Write("<td align='center'>"&curValue&"</td>")
else
Response.Write("<td> </td>")
end if
next
rs.movenext
%>
</tr>
<% loop while( not rs.eof) %>
</table>
<% else %>
<table width="100%" height="50" border="1" align="center">
<tr>
<td align="center" valign="middle" class="style1"> 您没有此项<%=session("sjmc")%></td>
</tr>
</table>
<%end if%>
</td>
</tr>
<%
rs.close
set rs=nothing
excel.Close
Set excel=Nothing
%>
2016年08月24日 07点08分
1
rs.close
set rs=nothing
excel.Close
Set excel=Nothing
set objExcelApp = CreateObject("Excel.Application")
objExcelApp.DisplayAlerts = false
objExcelApp.Application.Visible = false
strAddr = Server.MapPath(".")
objExcelApp.WorkBooks.Open(strAddr & "\Database\"&filename)
set objExcelBook = objExcelApp.ActiveWorkBook
'set objExcelSheets = objExcelBook.Worksheets
set objExcelSheet = objExcelBook.Sheets("Sheet1")
%>
<%for k=1 to filebths%>
<tr bgcolor="#C0D8F1" class="xsz">
<%
for j=1 to filebtls
temp=objExcelSheet.Cells(k,j).Value
temp1=objExcelSheet.Cells(k,j).mergecells
if temp1 then
ttemp =objExcelSheet.Cells(k,j).MergeArea.cells(1,1).address
tttemp=objExcelSheet.Cells(k,j).address
if ttemp = tttemp then
m=objExcelSheet.Cells(k,j).MergeArea.Columns.Count
n=objExcelSheet.Cells(k,j).MergeArea.rows.count
if trim(temp) ="" then temp=" "
stri="<td align='center' valign='middle' "
if m>1 then stri=stri&"colspan='"&m&"' "
if n>1 then stri=stri&"rowspan='"&n&"' "
stri=stri&">"&temp&"</td>"
Response.Write(stri)
end if
else
if trim(temp)= "" then
response.Write("<td> </td>")
else
response.Write("<td>"&temp&"</td>")
end if
end if
next
%>
</tr>
<%next%>
<%
objExcelApp.Quit
set objExcelApp = Nothing
%>
<%
strAddr = Server.MapPath(".\Dat\"&filename)
set excel=server.createobject("adodb.connection")
%><!--#include file="excel_ts.asp"--><%
set rs=server.CreateObject("adodb.recordset")
rs.open Sql,excel
%>
<% do %>
<tr>
<%
For j=0 To filebtls-1
curValue = rs.Fields(j).Value
if curValue<>"" then
Response.Write("<td align='center'>"&curValue&"</td>")
else
Response.Write("<td> </td>")
end if
next
rs.movenext
%>
</tr>
<% loop while( not rs.eof) %>
</table>
<% else %>
<table width="100%" height="50" border="1" align="center">
<tr>
<td align="center" valign="middle" class="style1"> 您没有此项<%=session("sjmc")%></td>
</tr>
</table>
<%end if%>
</td>
</tr>
<%
rs.close
set rs=nothing
excel.Close
Set excel=Nothing
%>