ASP递归层级表格数据展示

代码 如下:
<!--#include file="include/config.asp"-->
<!--#include file="common/sub_function.asp"-->
<htm>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>2012年6月工程进度报审表</title>
</head>
<body>
<table border="1"  cellpadding="0" cellspacing="0">
  <tr>
    <td width="260">项目费用名称</td>
    <td width="120">分项权重%</td>
    <td width="120">截止上月累计进度完成%</td>
    <td width="120">本月完成进度%(或里程碑点)</td>
    <td width="120">截止本月累计进度完成%</td>
    <td width="120">备注</td>
    </td>
  </tr>
  <%call wbs_tree(93,1)%>
</table>
<%
Function wbs_tree(id,i)
strSQL="SELECT * from PLN_projwbs where parent_wbs_id="&id&" order by seq_num"
Set rsTest = Server.CreateObject("ADODB.Recordset") '打开纪录集对象
rsTest.Open strSQL, cnn 
if not rsTest.eof then
	do while not rsTest.eof 
		wbs_id = rsTest("wbs_id")' WBS主键ID
		wbs_name=rsTest("wbs_name")'WBS名称
		haschild = ccint(rsTest("haschild"))'是否有子节点
		style = " style=""padding-left:"&(i*30)-30&"px"""'左填充WBS名称
		response.Write("<tr><td"&style&">"&wbs_name&"</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr>")
		if haschild=1 then
			call wbs_tree(wbs_id,i+1)'i为层级数
		end if
	rsTest.movenext
	loop
	rsTest.close 
	set rsTest=nothing 
end if
End Function
%>
</body>
</html></html>
<!--#include file="include/dispose.asp"-->


运行效果图如下:


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值