📄 excel.htm
字号:
<html>
<head>
<title>值班统计</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK REL=StyleSheet HREF="../../../../include/style.css" TYPE="text/css">
<script src="../../../../include/calendar.js"></script>
<SCRIPT language="JavaScript">
var aDataList = new Array();
function DataInfo(a1, a2, a3, a4, a5, a6, a7, a8, a9)
{
this.a1 = a1;
this.a2 = a2;
this.a3 = a3;
this.a4 = a4;
this.a5 = a5;
this.a6 = a6;
this.a7 = a7;
this.a8 = a8;
this.a9 = a9;
}
function putDataInExcel(sTitle, aDataList, iCount)
{
//*******************************
//参数说明:sTitle---------报表题目
// aDataList-------数据对象
//*******************************
//NO.1 Step: get Excel Sheet.
//***********************************************************************************************
if (iCount == 0) {
alert("无数据,不能进行该操作!")
return false;
}
var theSheet;
try
{
theSheet = getExcelSheet();
} catch(exception) {
alert("Error!" + "\n" + "可能原因是你的浏览器的安全级别太高!");
return false;
}
//***********************************************************************************************
//NO.2 Step:draw title
//***********************************************************************************************
theSheet.Cells(1,1).Value = sTitle;
with (theSheet.Range("A1:J2")) {
Font.Name = "楷体_GB2312"
Font.FontStyle = "加粗"
Font.Size = 18
RowHeight = 30
HorizontalAlignment = -4108
VerticalAlignment = -4108
Mergecells = true
}
//***********************************************************************************************
//NO.3 Step:draw theSheet
//***********************************************************************************************
theSheet.Cells(3, 1).Value = "单位";
with (theSheet.Range("A3:A4"))
{
Font.Name = "楷体_GB2312"
Font.FontStyle = "加粗"
Font.Size = 12
RowHeight = 25
HorizontalAlignment = -4131
VerticalAlignment = -4108
Mergecells = true
}
theSheet.Cells(3, 2).Value = "平日";
with (theSheet.Range("B3:C3"))
{
Font.Name = "楷体_GB2312"
Font.FontStyle = "加粗"
Font.Size = 12
RowHeight = 25
HorizontalAlignment = -4131
VerticalAlignment = -4108
Mergecells = true
}
theSheet.Cells(3, 4).Value = "双休日";
with (theSheet.Range("D3:E3"))
{
Font.Name = "楷体_GB2312"
Font.FontStyle = "加粗"
Font.Size = 12
RowHeight = 25
HorizontalAlignment = -4131
VerticalAlignment = -4108
Mergecells = true
}
theSheet.Cells(3, 6).Value = "法定假日";
with (theSheet.Range("F3:G3"))
{
Font.Name = "楷体_GB2312"
Font.FontStyle = "加粗"
Font.Size = 12
RowHeight = 25
HorizontalAlignment = -4131
VerticalAlignment = -4108
Mergecells = true
}
theSheet.Cells(3, 8).Value = "总计";
with (theSheet.Range("H3:I3"))
{
Font.Name = "楷体_GB2312"
Font.FontStyle = "加粗"
Font.Size = 12
RowHeight = 25
HorizontalAlignment = -4131
VerticalAlignment = -4108
Mergecells = true
}
theSheet.Cells(3, 10).Value = "签字";
with (theSheet.Range("J3:J4"))
{
Font.Name = "楷体_GB2312"
Font.FontStyle = "加粗"
Font.Size = 12
RowHeight = 25
HorizontalAlignment = -4131
VerticalAlignment = -4108
Mergecells = true
}
theSheet.Cells(4, 2).Value = "天";
theSheet.Cells(4, 3).Value = "元";
theSheet.Cells(4, 4).Value = "天";
theSheet.Cells(4, 5).Value = "元";
theSheet.Cells(4, 6).Value = "天";
theSheet.Cells(4, 7).Value = "元";
theSheet.Cells(4, 8).Value = "天";
theSheet.Cells(4, 9).Value = "元";
var cons = "A4:A" + (4 + parseInt(iCount));
for (var i = 0; i < iCount; i ++)
{
theSheet.Cells((5 + i), 1).Value = aDataList[i].a1;
theSheet.Cells((5 + i), 2).Value = aDataList[i].a2;
theSheet.Cells((5 + i), 3).Value = aDataList[i].a3;
theSheet.Cells((5 + i), 4).Value = aDataList[i].a4;
theSheet.Cells((5 + i), 5).Value = aDataList[i].a5;
theSheet.Cells((5 + i), 6).Value = aDataList[i].a6;
theSheet.Cells((5 + i), 7).Value = aDataList[i].a7;
theSheet.Cells((5 + i), 8).Value = aDataList[i].a8;
theSheet.Cells((5 + i), 9).Value = aDataList[i].a9;
theSheet.Cells((5 + i), 10).Value = "";
}
with (theSheet.Range("A3:J4")) {
Font.Name = "宋体"
Font.FontStyle = "加粗"
Font.Size = 9
RowHeight = 30
HorizontalAlignment = -4108
VerticalAlignment = -4108
Borders.LineStyle = 1
Borders.Weight = 2
Borders.ColorIndex = 1
Interior.ColorIndex = 34
Interior.Pattern = 1
Interior.PatternColorIndex = -4105
}
with (theSheet.Range(cons)) {
Font.Name = "宋体"
Font.FontStyle = "常规"
Font.Size = 9
RowHeight = 20
HorizontalAlignment = -4108
VerticalAlignment = -4108
Borders.LineStyle = 1
Borders.Weight = 2
Borders.ColorIndex = 1
Interior.ColorIndex = 34
Interior.Pattern = 1
Interior.PatternColorIndex = -4105
}
cons = "B5:J" + (4 + parseInt(iCount));
with (theSheet.Range(cons)) {
Font.Name = "宋体"
Font.FontStyle = "常规"
Font.Size = 9
RowHeight = 20
HorizontalAlignment = -4152
VerticalAlignment = -4108
Borders.LineStyle = 1
Borders.Weight = 2
Borders.ColorIndex = 1
NumberFormatLocal = "#,##0"
}
cons = "A" + (5 +parseInt(iCount)) + ":J" + (5 +parseInt(iCount));
theSheet.Cells((5 + iCount),1).Value = "注:值班费每日发放标准:平日班 25 元,双休日班 50 元,法定假日班 100 元";
with (theSheet.Range(cons)) {
Font.Name = "宋体"
Font.FontStyle = "常规"
Font.Size = 9
RowHeight = 20
HorizontalAlignment = -4108
VerticalAlignment = -4108
Borders.LineStyle = 1
Borders.Weight = 2
Borders.ColorIndex = 1
MergeCells = true
}
theSheet.Columns("A:A").ColumnWidth = 20;
theSheet.Columns("B:B").ColumnWidth = 10;
theSheet.Columns("C:C").ColumnWidth = 10;
theSheet.Columns("D:D").ColumnWidth = 10;
theSheet.Columns("E:E").ColumnWidth = 10;
theSheet.Columns("F:F").ColumnWidth = 10;
theSheet.Columns("G:G").ColumnWidth = 10;
theSheet.Columns("H:H").ColumnWidth = 10;
theSheet.Columns("I:I").ColumnWidth = 10;
theSheet.Columns("J:J").ColumnWidth = 10;
//***********************************************************************************************
}
function getExcelSheet() {//得到Excel工作表
var theSheet;
theApp = new ActiveXObject("Excel.Application");
theApp.Visible = true;
theApp.WorkBooks.Add
theSheet = theApp.ActiveSheet;
return theSheet
}
function GetAlphabet(number) {//输入数字得到字母,如0----A, 1-----B
var iCount;
var iRemainder;
var tmpstr;
iCount = parseInt(number/26)
iRemainder = number % 26
if (iCount == 0) {
tmpstr = String.fromCharCode(iRemainder + 65)
} else {
tmpstr = String.fromCharCode(iCount + 64) + String.fromCharCode(iRemainder + 65)
}
return tmpstr
}
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="dutyStat" method="post" action="/servlet/mca/oa/deptwork/dutymanager/dutystat/DutyStatServlet">
<table width="600" border="0" height="100%" cellpadding="0" cellspacing="0">
<tr><td valign="top">
<table width="95%" border="1" cellspacing="0" cellpadding="1" align="center" bordercolordark="#DFDFFF" bordercolorlight="#003366" bgcolor="#EEF4FF">
<tr>
<td width="15%" height="20">
<div align="center">开始日期</div>
</td>
<td width="35%" height="20">
<input type="text" name="beginDate" class="bt1" value="2002-01-01">
<img src="../../../../images/calendar.gif" style="cursor:hand;" width="17" height="17" border="0" align="middle" alt="弹出日历下拉菜单" onClick="document.dutyStat.beginDate.value=showCalendar(document.dutyStat.beginDate.value,400,200)">
</td>
<td width="15%" height="20">
<div align="center">结束日期</div>
</td>
<td width="35%" height="20">
<input type="text" name="endDate" class="bt1" value="2002-12-31">
<img src="../../../../images/calendar.gif" style="cursor:hand;" width="17" height="17" border="0" align="middle" alt="弹出日历下拉菜单" onClick="document.dutyStat.endDate.value=showCalendar(document.dutyStat.endDate.value,700,200)">
<input type="submit" name="Submit" class="bt1" value="统计">
</td>
</tr>
</table>
<br>
<table width="95%" border="1" cellspacing="0" cellpadding="1" align="center" bordercolordark="#DFDFFF" bordercolorlight="#003366" bgcolor="#EEF4FF">
<tr bgcolor="#A6D0F2">
<td colspan="10" height="25">
<div align="center">2002-01-01 到 2002-12-31值班费用领取表</div>
</td>
</tr>
<tr>
<td rowspan="2" width="20%">
<div align="center">单位</div>
</td>
<td colspan="2" height="25">
<div align="center">平日班</div>
</td>
<td colspan="2" height="25">
<div align="center">双休日班</div>
</td>
<td colspan="2" height="25">
<div align="center">法定假日班</div>
</td>
<td colspan="2" height="25">
<div align="center">合计</div>
</td>
</tr>
<tr>
<td width="10%" height="25">
<div align="center">天</div>
</td>
<td width="10%" height="25">
<div align="center">元</div>
</td>
<td width="10%" height="25">
<div align="center">天</div>
</td>
<td width="10%" height="25">
<div align="center">元</div>
</td>
<td width="10%" height="25">
<div align="center">天</div>
</td>
<td width="10%" height="25">
<div align="center">元</div>
</td>
<td width="10%" height="25">
<div align="center">天</div>
</td>
<td width="10%" height="25">
<div align="center">元</div>
</td>
</tr>
<tr>
<td width="20%" height="25">
<div align="center">救济救灾司</div>
</td>
<td width="10%" height="25">
<div align="center">0</div>
</td>
<td width="10%" height="25">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -