高分,高分求一个可以动态生成临时报表的程序(二),在线等!

要能对这个报表进行添加,修改,删除,查询,统计功能;报表的单元格未知,由用户输入。

我对ASP着实不熟,希望哪个高手帮忙。

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

'作者:gOODiDEA
'http://www.gnovels.com
'''''''''''''''''''''''''''''''''''''''''''''''
''index.asp
'''''''''''''''''''''''''''''''''''''''''''''''

1<html>
2<head>
3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
4<title>动态表格生成</title>
5<link href="../css/office.css" rel="stylesheet" type="text/css"/>
6</head>
7<body>
8<!--#include file="../include/ni_func.asp" -->
9<!--#include file="../include/conn.asp" -->   

m_step = Request("m_step")
m_act = Request("m_act")
if m_step = "" then
m_step = 1
end if
Select Case m_step
Case 1
if m_act = 1 then
ChineseName = Request("ChineseName")
'根据日期得到文件名,数据表名
DateTime = Now
CurrentDateValue = DateValue( DateTime )
CurrentTimeValue = TimeValue( DateTime )
CurrentDateValue = Year( CurrentDateValue ) &amp; Month( CurrentDateValue ) &amp; Day( CurrentDateValue )
CurrentTimeValue = Hour( CurrentTimeValue ) &amp; Minute( CurrentTimeValue ) &amp; Second( CurrentTimeValue )
EnglishName = "ni_"&amp;CurrentDateValue&amp;CurrentTimeValue
'DebugVar EnglishName
'EnglishName = Request("EnglishName")
m_num = Request("m_num")

set FileSystemObject = Server.CreateObject("Scripting.FileSystemObject")
TempPath = Request.ServerVariables("Path_Translated")
Path = Left( TempPath, InStrRev( TempPath, "") )
FileName = EnglishName&amp;".inc"
CurrentFile = Path&amp;FileName
Set NewFile = FileSystemObject.OpenTextFile( CurrentFile, 2, True )
NewFile.WriteLine( ChineseName &amp; "##@@" &amp; EnglishName )
NewFile.WriteLine( m_num )
NewFile.Close
Set NewFile = Nothing
Set FileSystemObject = Nothing

Response.Redirect "index.asp?m_step=2&amp;CurrentFile="&amp;CurrentFile
else

 1<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableframe" width="500">
 2<form action="index.asp?m_step=1&amp;m_act=1" method="post" name="myform">
 3<tr class="titlebar">
 4<td height="30" width="31%"><font color="#FFFFFF"><strong>第一步:</strong></font></td>
 5<td height="30" width="69%"><font color="#CCCCCC">请输入报表的名字和选择报表的数据列。</font></td>
 6</tr>
 7<tr class="titlebar">
 8<td bgcolor="#88C4FF" colspan="2" height="4"> </td>
 9</tr>
10<tr>
11<td class="ListCellTitle" height="30" width="31%"> <div align="center">请输入表的中文名:</div></td>
12<td class="ListCellTitle" height="30" width="69%">      <input class="input" id="ChineseName" maxlength="50" name="ChineseName" size="30" type="text"/>
13</td>
14</tr>
15<tr>
16<td class="ListCellTitle" height="30"><div align="center">请选数据列的个数:</div></td>
17<td class="ListCellTitle" height="30" width="69%">     <select class="edit_table_td_input" name="m_num">
18<option value="">请选择</option>   

for i = 2 to 20

1<option value="```
2= i 
3```">```
4=i
5```个</option>   

next

1</select> </td>
2</tr>
3<tr align="center">
4<td colspan="2" height="30"> <input class="button" name="button" onclick="checkFormInput( 'ChineseName', '请输入表的中文名!' )" type="button" value="下一步&gt;&gt;"/>
5</td>
6</tr>
7</form>
8</table>   

End If

Case 2
if m_act = 1 then
CurrentFile = Request("CurrentFile")
'Debugvar ( CurrentFile )
m_num = Request("m_num")
set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set AppendFile = FSO.OpenTextFile( CurrentFile, 8, True )
for i = 1 to m_num - 1
'Response.Write Request("m_m"&amp;i)
AppendFile.Write( "m_m"&amp;i&amp;"##@@" )
next
AppendFile.Write( "m_m"&amp;m_num )&amp;VbCrlf
for i = 1 to m_num - 1
'Response.Write Request("m_m"&amp;i)
AppendFile.Write( Request("m_m"&amp;i)&amp;"##@@" )
next
AppendFile.Write( Request("m_m"&amp;m_num) )&amp;VbCrlf
AppendFile.Close
Set AppendFile = Nothing
Set FSO = Nothing

Response.Redirect "index.asp?m_step=3&amp;CurrentFile="&amp;CurrentFile
else

Published At
Categories with Web编程
Tagged with
comments powered by Disqus