⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 step2.asp

📁 学生档案与成绩管理(1)学生档案管理:记录每个学生的档案信息
💻 ASP
字号:
<!-- #include file = "../../../../include/asphead.asp" -->
<!-- #include file = "../../../../include/function.asp" -->
<%CheckUser()%>
<link href="../../../../include/main.css" rel="stylesheet" type="text/css">
<script src="../../../../include/function.js" type="text/javascript"></script>

<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--

var CurElement,CurListIndex;	//已加入区最后焦点所在的Element,ListIndex

CurListIndex=-1;

function LocalDC()
{
	if(RowField.length==0 && ColumnField.length==0)
	{
		alert("您未选择分类字段,请选择。")
		return false;
	}	
	if(SumField.length==0)
	{
		alert("您未选择汇总字段,请选择。")
		return false;
	}	
	return true;
}

function Pre() 
{
	window.navigate("../designstep1.asp");
}

function Next()
{
	if(LocalDC()==true)
	{
		var Row,Column,Sum
		Row=""
		Column=""
		Sum=""
		if(RowField.length>=0)
			for(var i=1;i<=RowField.length;i++)
				if (Row=="")
					Row=RowField.options[i-1].value
				else
					Row=Row + "," + RowField.options[i-1].value
		if(ColumnField.length>=0)
			for(var i=1;i<=ColumnField.length;i++)
				if (Column=="")
					Column=ColumnField.options[i-1].value
				else
					Column=Column + "," + ColumnField.options[i-1].value
		if(SumField.length>=0)
			for(var i=1;i<=SumField.length;i++)
				if (Sum=="")
					Sum=SumField.options[i-1].value
				else
					Sum=Sum + "," + SumField.options[i-1].value
		DisableButton();
		frmData.RowField.value =Row;
		frmData.ColumnField.value =Column;
		frmData.SumField.value =Sum;
		frmData.target ="SaveArea";
		frmData.action="savefield.asp";
		frmData.submit();
	}
}

function Cancel() 
{
	var discard;
	discard=confirm(document.all.btnCancel.value+"报表设计吗?");
	if(discard==true)
	{
		if(NewReport.value==1)
		{
			DisableButton();
			document.frmData.target ="SaveArea";
			document.frmData.action="../cancel.asp";
			document.frmData.submit();
		}
		else
		{
			alert("尚未完成设计,暂不能查询和生成报表。");
			parent.window.returnValue = true;
			parent.window.close();
		}
	}
}

function DisableButton() 
{
	btnCancel.disabled =true;
	btnPre.disabled =true;
	btnNext.disabled =true;
}

function EnableButton() 
{
	btnCancel.disabled =false;
	btnPre.disabled =false;
	btnNext.disabled =false;
}

function AddRow() 
{
	var srcIndex;
	srcIndex=AvailableField.selectedIndex;
	if(srcIndex==-1)
	{
		alert("您要加入哪个字段?请在上面的区域中选择。"); 
		return false;
	}

	var Index,ID;
	ID=AvailableField.options[srcIndex].value;
	if(ID==RecordCount_ID)
	{
		alert(RecordCount_Caption+"只能用作汇总字段,请选择其它字段。"); 
		return false;
	}
		
	if(RowField.length>=3)
	{
		alert("最多选用3个行分类字段。"); 
		return false;
	}

	Index=GetIndex(ID,FieldID);
	if(Index>=0)
	{
		//插入目标list
		var targetIndex=RowField.length;
		RowField.options[targetIndex]=new Option("2",1)
		RowField.options[targetIndex].value=AvailableField.options[srcIndex].value
		RowField.options[targetIndex].text=AvailableField.options[srcIndex].text
		//从源list移除
		var srcLastIndex;
		srcLastIndex=AvailableField.length-1;
		if(srcLastIndex>srcIndex)
		{
			for(var i=srcIndex;i<srcLastIndex;i++)
			{
				AvailableField.options[i].value=AvailableField.options[i+1].value
				AvailableField.options[i].text=AvailableField.options[i+1].text
			}
		}
		AvailableField.length=AvailableField.length-1;
	}
}

function AddColumn() 
{
	var srcIndex;

	srcIndex=AvailableField.selectedIndex;
	if(srcIndex==-1)
	{
		alert("您要加入哪个字段?请在上面的区域中选择。"); 
		return false;
	}

	var Index,ID;
	ID=AvailableField.options[srcIndex].value;
	if(ID==RecordCount_ID)
	{
		alert(RecordCount_Caption+"只能用作汇总字段,请选择其它字段。"); 
		return false;
	}
			
	if(ColumnField.length>=3)
	{
		alert("最多选用3个列分类字段。"); 
		return false;
	}

	Index=GetIndex(ID,FieldID);
	if(Index>=0)
	{
		//插入目标list
		var targetIndex=ColumnField.length;
		ColumnField.options[targetIndex]=new Option("2",1)
		ColumnField.options[targetIndex].value=AvailableField.options[srcIndex].value
		ColumnField.options[targetIndex].text=AvailableField.options[srcIndex].text
		//从源list移除
		var srcLastIndex;
		srcLastIndex=AvailableField.length-1;
		if(srcLastIndex>srcIndex)
		{
			for(var i=srcIndex;i<srcLastIndex;i++)
			{
				AvailableField.options[i].value=AvailableField.options[i+1].value
				AvailableField.options[i].text=AvailableField.options[i+1].text
			}
		}
		AvailableField.length=AvailableField.length-1;
	}
}

function AddSum() 
{
	var srcIndex;
	srcIndex=AvailableField.selectedIndex;
	if(SumField.length>0)
			alert("您已选有汇总字段。系统目前只支持一个汇总字段。");	
	else if(srcIndex==-1)
		alert("您要加入哪个字段?请在上面的区域中选择。"); 
	else
	{
		var Index,ID,Type;
		ID=AvailableField.options[srcIndex].value;
		Index=GetIndex(ID,FieldID);
		if(Index>=0)
		{
			Type=FieldType[Index];
			if(Type!=DataType_Number)
				alert(FieldCaption[Index]+"不是数值型字段,只有数值型字段才可以作汇总。"); 
			else
			{
				//插入目标list
				var targetIndex=SumField.length;
				SumField.options[targetIndex]=new Option("2",1)
				SumField.options[targetIndex].value=AvailableField.options[srcIndex].value
				SumField.options[targetIndex].text=AvailableField.options[srcIndex].text
				//从源list移除
				var srcLastIndex;
				srcLastIndex=AvailableField.length-1;
				if(srcLastIndex>srcIndex)
				{
					for(var i=srcIndex;i<srcLastIndex;i++)
					{
						AvailableField.options[i].value=AvailableField.options[i+1].value
						AvailableField.options[i].text=AvailableField.options[i+1].text
					}
				}
				AvailableField.length=AvailableField.length-1;
			}
		}
	}
}

function SelectedClick()
{
  CurElement=window.event.srcElement;
  CurListIndex=CurElement.selectedIndex;
	if(CurElement.name=="RowField")
	{
		ColumnField.selectedIndex =-1;
		SumField.selectedIndex =-1;
	}
	else if(CurElement.name=="ColumnField")
	{
		RowField.selectedIndex =-1;
		SumField.selectedIndex =-1;
	}
	else if(CurElement.name=="SumField")
	{
		RowField.selectedIndex =-1;
		ColumnField.selectedIndex =-1;
	}
}

function Remove() 
{
	if(CurListIndex==-1)
		alert("您要移除哪个字段?请在下面的区域中选择。"); 
	else
	{
		//插入目标list
		var targetIndex=AvailableField.length;
		AvailableField.options[targetIndex]=new Option("2",1)
		AvailableField.options[targetIndex].value=CurElement.options[CurListIndex].value
		AvailableField.options[targetIndex].text=CurElement.options[CurListIndex].text
		//从源list移除
		var srcLastIndex;
		srcLastIndex=CurElement.length-1;
		if(srcLastIndex>CurListIndex)
		{
			for(var i=CurListIndex;i<srcLastIndex;i++)
			{
				CurElement.options[i].value=CurElement.options[i+1].value
				CurElement.options[i].text=CurElement.options[i+1].text
			}
		}
		CurElement.length=CurElement.length-1;
		//将当前位置定位在下一个item
		if(CurElement.length>0)
		{
			srcLastIndex=CurElement.length-1;
			if(CurListIndex>srcLastIndex)
			{
				CurElement.selectedIndex=srcLastIndex;
				CurListIndex=srcLastIndex;
			}
			else
				CurElement.selectedIndex=CurListIndex;
		}
		else
			CurListIndex=-1;
	}

}

//-->
</script>
<%
	dim WExcel
	set WExcel=server.CreateObject("WExcel.Report")

	dim NewReport,Cancel
	NewReport=Request.Cookies("System")("NewReport")
	if NewReport="1" then
		Cancel="取消"
	else
		Cancel="退出"
	end if

	dim SheetID,ReportID
	SheetID=Request.Cookies("System")("ReportSheetID")
	ReportID=Request.Cookies("System")("ReportID")
	
	dim AvailableField,RowField,ColumnField,SumField,GCScript
	WExcel.GetAnalyzeField cint(UserID), cint(SheetID), cint(ReportID), AvailableField, RowField, ColumnField, SumField, GCScript
	Response.Write GCScript
	CheckErr
%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
	</head>
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" valign=top>
		<table width="100%" border="0" align="center">
			<tr height="35">
				<td colspan="3">
					<b>第2步:选择分类字段、汇总字段</b>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					行分类就是将不同的字段值排成若干行,列分类就是排成若干列。
				</td>
			</tr>
			<tr>
				<td width="20%">
					待选字段
				</td>
				<td colspan="2">
	        <select id="AvailableField" name="AvailableField" size="4" style="width:360px;">
						<%=AvailableField%>
	        </select>
				</td>
			</tr>
			<tr>
				<td width="20%">
				</td>
				<td colspan="2">
					<table align="center" width="50%">
						<tr>
							<td width="25%"><input id="btnAddRow" type="button" value="加入行分类" name="btnAddRow" style="cursor:hand; WIDTH: 85px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return AddRow()"></td>
							<td width="25%"><input id="btnAddSum" type="button" value="加入汇总" name="btnAddSum" style="cursor:hand; WIDTH: 85px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return AddSum()"></td>
							<td width="25%"><input id="btnAddColumn" type="button" value="加入列分类" name="btnAddColumn" style="cursor:hand; WIDTH: 85px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return AddColumn()"></td>
							<td width="25%"><input id="btnRemove" type="button" value="移除" name="btnRemove" style="cursor:hand; WIDTH: 85px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return Remove()"></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td colspan=2>
				</td>
				<td>
					<img name="analyzefield2" align="left" src="../../../../images/analyzefield2.gif" WIDTH="56" HEIGHT="16">
				</td>
			</tr>
			<tr>
				<td width="20%" rowspan=2>
					入选字段
				</td>
				<td width="40%">
					<img name="analyzefield" align="right" src="../../../../images/analyzefield.gif" WIDTH="146" HEIGHT="46">
				</td>
				<td width="40%">
					<p align="left">
						<select id="ColumnField" name="ColumnField" size="2" style="width:180px;" onclick="SelectedClick()">
							<%=ColumnField%>
						</select>
					</p>
				</td>
			</tr>
			<tr>
				<td width="40%">
					<p align="right">
						<select id="RowField" name="RowField" size="2" style="width:180px;" onclick="SelectedClick()">
							<%=RowField%>
						</select>
					</p>
				</td>
				<td width="40%">
					<p align="left">
						<select id="SumField" name="SumField" size="2" style="width:180px;" onclick="SelectedClick()">
							<%=SumField%>
						</select>
					</p>
				</td>
			</tr>
			<tr height="49" valign="bottom">
				<td colspan="3">
					<table align="center" width="50%">
						<tr>
							<td width="33%"><input id="btnCancel" type="button" value="<%=Cancel%>" name="btnCancel" style="cursor:hand; WIDTH: 65px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return Cancel()"></td>
							<td width="33%"><input id="btnPre" type="button" value="上一步" name="btnPre" style="cursor:hand; WIDTH: 65px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return Pre()"></td>
							<td width="33%"><input id="btnNext" type="button" value="下一步" name="btnNext" style="cursor:hand; WIDTH: 65px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return Next()"></td>
						</tr>
					</table>
				</td>
			</tr>
			<iframe id="SaveArea" name="SaveArea" style="VISIBILITY: hidden" width="0" height="0" frameborder="0" src="">
			</iframe>
			<form METHOD="post" name="frmData">
				<input TYPE="hidden" NAME="RowField">
				<input TYPE="hidden" NAME="ColumnField">
				<input TYPE="hidden" NAME="SumField">
			</form>
			<input TYPE="hidden" NAME="NewReport" value="<%=NewReport%>">
		</table>
	</body>                                                                                                           
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -