求助,Execl问题

shanbeiwa 2004-08-02 04:16:29
代码如下,这样做只有Execl,表格中没有值,请问怎么给表格赋值?
<object classid="clsid:0002E510-0000-0000-C000-000000000046" id="Spreadsheet1" codebase="file:///L:/Installation/Simple-Office%202000/msowc.cab" width="778" height="500">
<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:auto;}
td
{white-space:nowrap;}
.wcCA73D23
{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;}
-->
</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='border-top:solid .5pt silver;border-left:solid .5pt silver;
border-right:solid .5pt silver;border-bottom:solid .5pt silver'>
<x:Caption>Microsoft Office Spreadsheet</x:Caption>
</x:Label>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:Selected/>
<x:Height>8229</x:Height>
<x:Width>15134</x:Width>
<x:TopRowVisible>0</x:TopRowVisible>
<x:LeftColumnVisible>0</x:LeftColumnVisible>
<x:ProtectContents>False</x:ProtectContents>
<x:DefaultRowHeight>280</x:DefaultRowHeight>
<x:StandardWidth>2550</x:StandardWidth>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:MaxHeight>80%</x:MaxHeight>
<x:MaxWidth>80%</x:MaxWidth>
</x:ExcelWorkbook>
</xml><![endif]-->

<table class=wcCA73D23 x:str>

<%
for r=1 to pagesizes
'rsStyle.AbsolutePosition=r
if rsStyle.EOF then exit for
Response.write "<tr>"

For i = 0 to num - 1
Response.write "<td><nobr></nobr></td>"

';;;;;;;;;;;按正常表格输出;;;;;;;;;;;;;
' Response.write "</nobr></td>"
Next
Response.write "</tr>"
rsStyle.movenext
next

%>
</table>
</body>
</html>
">
<param name="DataType" value="HTMLDATA">
<param name="AutoFit" value="0">
<param name="DisplayColHeaders" value="-1">
<param name="DisplayGridlines" value="-1">
<param name="DisplayHorizontalScrollBar" value="-1">
<param name="DisplayRowHeaders" value="-1">
<param name="DisplayTitleBar" value="0">
<param name="DisplayToolbar" value="-1">
<param name="DisplayVerticalScrollBar" value="-1">
<param name="EnableAutoCalculate" value="-1">
<param name="EnableEvents" value="-1">
<param name="MoveAfterReturn" value="-1">
<param name="MoveAfterReturnDirection" value="0">
<param name="RightToLeft" value="0">
<param name="ViewableRange" value="1:30">
</object>
...全文
97 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
shanbeiwa 2004-08-03
在顶一下
回复
shanbeiwa 2004-08-03
谢谢,但是怎么输出?能告诉我吗?
回复
shanbeiwa 2004-08-03
不行,出现如下错误
无法显示 XML 页。
使用 XSL 样式表无法查看 XML 输入。请更正错误然后单击 刷新按钮,或以后重试。


--------------------------------------------------------------------------------

名称包含无效字符。处理资源 'http://fallso/zjeisn1/economy/test.asp' 时出错。第 1 行,位置: 100

<OBJECT style="LEFT: 0px; TOP: 0px" classid="clsid:0002E551-0000-0000-C000-000000000046" VIEWASTEXT>


回复
runmin 2004-08-03
<OBJECT style="LEFT: 0px; TOP: 0px" classid="clsid:0002E551-0000-0000-C000-000000000046" VIEWASTEXT>
<PARAM NAME="DataType" VALUE="XMLDATA">
<PARAM NAME="XMLData" VALUE='<?xml version="1.0"?> <ss:Workbook xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet"> <x:ExcelWorkbook> <x:ProtectStructure>False</x:ProtectStructure> <x:ActiveSheet>0</x:ActiveSheet> </x:ExcelWorkbook> <ss:Styles> <ss:Style ss:ID="Default"> <ss:Alignment ss:Horizontal="Automatic" ss:Rotate="0.0" ss:Vertical="Bottom" ss:ReadingOrder="Context"/> <ss:Borders> </ss:Borders> <ss:Font ss:FontName="宋体" ss:Size="11" ss:Color="Automatic" ss:Bold="0" ss:Italic="0" ss:Underline="None"/> <ss:Interior ss:Color="Automatic" ss:Pattern="None"/> <ss:NumberFormat ss:Format="General"/> <ss:Protection ss:Protected="1"/> </ss:Style> </ss:Styles> <c:ComponentOptions> <c:Label> <c:Caption>Microsoft Office 电子表格</c:Caption> </c:Label> <c:MaxHeight>80%</c:MaxHeight> <c:MaxWidth>80%</c:MaxWidth> <c:NextSheetNumber>4</c:NextSheetNumber> </c:ComponentOptions> <x:WorkbookOptions> <c:OWCVersion>10.0.0.5605 </c:OWCVersion> <x:Height>7620</x:Height> <x:Width>15240</x:Width> </x:WorkbookOptions> <ss:Worksheet ss:Name="Sheet1"> <x:WorksheetOptions> <x:Selected/> <x:ViewableRange>R1:R262144</x:ViewableRange> <x:Selection>R1C1</x:Selection> <x:TopRowVisible>0</x:TopRowVisible> <x:LeftColumnVisible>0</x:LeftColumnVisible> <x:ProtectContents>False</x:ProtectContents> </x:WorksheetOptions> <c:WorksheetOptions> </c:WorksheetOptions> <ss:Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" ss:DefaultColumnWidth="54.0" ss:DefaultRowHeight="12.75"> <ss:Row> <ss:Cell> <ss:Data ss:Type="String">asdf</ss:Data> </ss:Cell> </ss:Row> </ss:Table> </ss:Worksheet> <ss:Worksheet ss:Name="Sheet2"> <x:WorksheetOptions> <x:ViewableRange>R1:R262144</x:ViewableRange> <x:Selection>R1C1</x:Selection> <x:TopRowVisible>0</x:TopRowVisible> <x:LeftColumnVisible>0</x:LeftColumnVisible> <x:ProtectContents>False</x:ProtectContents> </x:WorksheetOptions> <c:WorksheetOptions> </c:WorksheetOptions> <ss:Table ss:DefaultColumnWidth="54.0" ss:DefaultRowHeight="12.75"> </ss:Table> </ss:Worksheet> <ss:Worksheet ss:Name="Sheet3"> <x:WorksheetOptions> <x:ViewableRange>R1:R262144</x:ViewableRange> <x:Selection>R1C1</x:Selection> <x:TopRowVisible>0</x:TopRowVisible> <x:LeftColumnVisible>0</x:LeftColumnVisible> <x:ProtectContents>False</x:ProtectContents> </x:WorksheetOptions> <c:WorksheetOptions> </c:WorksheetOptions> <ss:Table ss:DefaultColumnWidth="54.0" ss:DefaultRowHeight="12.75"> </ss:Table> </ss:Worksheet> </ss:Workbook> '>
<PARAM NAME="AllowPropertyToolbox" VALUE="-1">
<PARAM NAME="AutoFit" VALUE="0">
<PARAM NAME="Calculation" VALUE="-4105">
<PARAM NAME="Caption" VALUE="Microsoft Office 电子表格">
<PARAM NAME="DisplayColumnHeadings" VALUE="-1">
<PARAM NAME="DisplayGridlines" VALUE="-1">
<PARAM NAME="DisplayHorizontalScrollBar" VALUE="-1">
<PARAM NAME="DisplayOfficeLogo" VALUE="-1">
<PARAM NAME="DisplayPropertyToolbox" VALUE="0">
<PARAM NAME="DisplayRowHeadings" VALUE="-1">
<PARAM NAME="DisplayTitleBar" VALUE="0">
<PARAM NAME="DisplayToolbar" VALUE="-1">
<PARAM NAME="DisplayVerticalScrollBar" VALUE="-1">
<PARAM NAME="DisplayWorkbookTabs" VALUE="-1">
<PARAM NAME="EnableEvents" VALUE="-1">
<PARAM NAME="MaxHeight" VALUE="80%">
<PARAM NAME="MaxWidth" VALUE="80%">
<PARAM NAME="MoveAfterReturn" VALUE="-1">
<PARAM NAME="MoveAfterReturnDirection" VALUE="-4121">
<PARAM NAME="RightToLeft" VALUE="0">
<PARAM NAME="ScreenUpdating" VALUE="-1">
<PARAM NAME="EnableUndo" VALUE="-1"></OBJECT>


注意这段,这段就是数据内容,生成这部分内容Spread sheet控件就会显示了。


<ss:Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" ss:DefaultColumnWidth="54.0" ss:DefaultRowHeight="12.75"> <ss:Row> <ss:Cell> <ss:Data ss:Type="String">asdf</ss:Data> </ss:Cell> </ss:Row> </ss:Table> </ss:Worksheet> <ss:Worksheet ss:Name="Sheet2"> <x:WorksheetOptions> <x:ViewableRange>R1:R262144</x:ViewableRange> <x:Selection>R1C1</x:Selection> <x:TopRowVisible>0</x:TopRowVisible> <x:LeftColumnVisible>0</x:LeftColumnVisible> <x:ProtectContents>False</x:ProtectContents> </x:WorksheetOptions> <c:WorksheetOptions> </c:WorksheetOptions> <ss:Table ss:DefaultColumnWidth="54.0" ss:DefaultRowHeight="12.75"> </ss:Table> </ss:Worksheet> <ss:Worksheet ss:Name="Sheet3"> <x:WorksheetOptions> <x:ViewableRange>R1:R262144</x:ViewableRange> <x:Selection>R1C1</x:Selection> <x:TopRowVisible>0</x:TopRowVisible> <x:LeftColumnVisible>0</x:LeftColumnVisible> <x:ProtectContents>False</x:ProtectContents> </x:WorksheetOptions> <c:WorksheetOptions> </c:WorksheetOptions> <ss:Table ss:DefaultColumnWidth="54.0" ss:DefaultRowHeight="12.75"> </ss:Table>
回复
lanechng 2004-08-02
我测了一下,代码没问题.
只要在
<%
for r=1 to pagesizes
'rsStyle.AbsolutePosition=r
if rsStyle.EOF then exit for
Response.write "<tr>"

For i = 0 to num - 1
Response.write "<td><nobr></nobr></td>"

';;;;;;;;;;;按正常表格输出;;;;;;;;;;;;;
' Response.write "</nobr></td>"
Next
Response.write "</tr>"
rsStyle.movenext
next

%>
处输出值就行了!!
回复
shanbeiwa 2004-08-02
自己顶一下
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-08-02 04:16
社区公告
暂无公告