答案:看了精华区中众多处理EXCEL的贴子,好象没有人写这种操作方法,我把我做过的写出来给大家参考一下。
1、先在FrongPage中新建一个网页,在网页中插入一个EXCEL组件(插入-WEB组件-EXCEL电子表格),然后把你要输出的数据格式输入该嵌入的EXCEL表格中,在组件中点右键-属性,可定义该组件的各部分定义项,做好后,查看源代码,得到该嵌入组件的源代码。
2、在VID中新建一ASP网页,复制上步骤中的源代码,然后针对数据列加入循环取数代码。如下:
<object classid="clsid:0002E510-0000-0000-C000-000000000046" id="Spreadsheet1" codebase="msowc.cab" width="599" height="490">
<param name="HTMLURL" value>
<param name="HTMLData" value="<html xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<style type="text/css">
<!--tr
{mso-height-source:userset;}
td
{white-space:nowrap;}
.wc80A6909
{white-space:nowrap;
font-family:宋体;
mso-number-format:General;
font-size:auto;
font-weight:auto;
font-style:auto;
text-decoration:auto;
mso-background-source:auto;
mso-pattern:auto;
mso-color-source:auto;
text-align:general;
vertical-align:bottom;
border-top:none;
border-left:none;
border-right:none;
border-bottom:none;
mso-protection:locked;}
.wc01F2F7A
{white-space:nowrap;
font-family:宋体;
mso-number-format:General;
font-size:auto;
font-weight:auto;
font-style:auto;
text-decoration:auto;
mso-background-source:auto;
mso-pattern:auto;
mso-color-source:auto;
text-align:general;
vertical-align:bottom;
border-top:none;
border-left:none;
border-right:none;
border-bottom:none;
mso-protection:locked;}
.wc0EA6F7A
{white-space:nowrap;
font-family:宋体;
mso-number-format:General;
font-size:auto;
font-weight:auto;
font-style:auto;
text-decoration:auto;
mso-background-source:auto;
mso-pattern:auto;
mso-color-source:auto;
text-align:center;
vertical-align:bottom;
border-top:none;
border-left:none;
border-right:none;
border-bottom:none;
mso-protection:locked;}
-->
</style>
</head>
<body>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:OWCVersion>9.0.0.2710</x:OWCVersion>
<x:Label Style='font-size:11pt;border-top:solid .5pt silver;border-left:
solid .5pt silver;border-right:solid .5pt silver;border-bottom:solid .5pt silver'>
<x:Caption>返工处理日报表-产成品出入库报表-<%=trim(rs_stock("fname"))%>(<%=sdate%>至<%=edate%>)</x:Caption>
</x:Label>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:Selected/>
<x:Height>12965</x:Height>
<x:Width>13996</x:Width>
<x:TopRowVisible>0</x:TopRowVisible>
<x:LeftColumnVisible>0</x:LeftColumnVisible>
<x:ProtectContents>False</x:ProtectContents>
<x:DefaultRowHeight>315</x:DefaultRowHeight>
<x:StandardWidth>2389</x:StandardWidth>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:MaxHeight>80%</x:MaxHeight>
<x:MaxWidth>80%</x:MaxWidth>
</x:ExcelWorkbook>
</xml><![endif]-->
<table class=wc01F2F7A x:str>
<col class=wc01F2F7A width="86" style='mso-width-source:userset'>
<col class=wc01F2F7A width="112" style='mso-width-source:userset'>
<col class=wc01F2F7A width="66" style='mso-width-source:userset'>
<col width="83" style='mso-width-source:userset'>
<col width="56">
<col width="82" style='mso-width-source:userset'>
<tr height="21" style='mso-height-source:userset'>
<td class=wc01F2F7A>返工处理日报表-产成品出入库报表-<%=trim(rs_stock("fname"))%>(<%=sdate%>至<%=edate%>)</td>
<td class=wc01F2F7A></td>
<td class=wc01F2F7A></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr height="21" style='mso-height-source:userset'>
<td class=wc01F2F7A>仓库名称:</td>
<td class=wc01F2F7A><%=trim(rs_stock("fname"))%></td>
<td class=wc01F2F7A>统计日期:</td>
<td><%=cstr(sdate)%></td>
<td class=wc0EA6F7A>至</td>
<td><%=cstr(edate)%></td>
</tr>
<tr height="21" style='mso-height-source:userset'>
<td class=wc80A6909>物料短代码</td>
<td class=wc80A6909>物料长代码</td>
<td class=wc80A6909>物料名称</td>
<td class=wc80A6909>返工转出</td>
<td>即时库存</td>
<td></td>
<td></td>
</tr>
<%
'开始数据库
上一个:找到了,解密SQL2000的存储过程
下一个:通过MS SQL 数据库SA帐号增加新用户至administrators组