要能对这个报表进行添加,修改,删除,查询,统计功能;报表的单元格未知,由用户输入。
我对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 ) & Month( CurrentDateValue ) & Day( CurrentDateValue )
CurrentTimeValue = Hour( CurrentTimeValue ) & Minute( CurrentTimeValue ) & Second( CurrentTimeValue )
EnglishName = "ni_"&CurrentDateValue&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&".inc"
CurrentFile = Path&FileName
Set NewFile = FileSystemObject.OpenTextFile( CurrentFile, 2, True )
NewFile.WriteLine( ChineseName & "##@@" & EnglishName )
NewFile.WriteLine( m_num )
NewFile.Close
Set NewFile = Nothing
Set FileSystemObject = Nothing
Response.Redirect "index.asp?m_step=2&CurrentFile="&CurrentFile
else
1<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableframe" width="500">
2<form action="index.asp?m_step=1&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="下一步>>"/>
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"&i)
AppendFile.Write( "m_m"&i&"##@@" )
next
AppendFile.Write( "m_m"&m_num )&VbCrlf
for i = 1 to m_num - 1
'Response.Write Request("m_m"&i)
AppendFile.Write( Request("m_m"&i)&"##@@" )
next
AppendFile.Write( Request("m_m"&m_num) )&VbCrlf
AppendFile.Close
Set AppendFile = Nothing
Set FSO = Nothing
Response.Redirect "index.asp?m_step=3&CurrentFile="&CurrentFile
else