1、列表(前台)

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="w_studentTrainResultSearch.aspx.cs" Inherits="DTMIS.Web.StudentMG.w_studentTrainResultSearch" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="../js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<%-- <script src="../js/WebCalendar.js" type="text/javascript"></script>--%>
<link href="../Include/StyleFile.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
var tr;
var _bgColor;
$(function () {
$("#DataGrid1 tr:gt(0)").hover(
function () {
tr = $(this);
if (tr.rowIndex != 0) {
_bgColor = tr.css("backgroundColor");
tr.css("backgroundColor", "#ffc051");
}
},
function () {
tr.css("backgroundColor", _bgColor);
}
);
}); //批量打印
function PrintUrl()
{
var canshu = "<%= canshu%>";
var canshuUrl = "";
var canshus = canshu.split('|');
var IfBlankPrint = ($("#ChbIfBlankPrint").attr("checked") == true) ? 0 : 1;
var chks = document.getElementsByName("DataGrid1_CheckSingle");
if (chks != null && chks.length != 0) {
var len = chks.length;
for (var i = 0; i < len; i++) {
var chk = chks[i]
if (chk.checked) {
canshuUrl += canshus[i] + "," + IfBlankPrint + "|";
}
}
}
if (canshuUrl!= "") {
var canshusub = canshuUrl.substr(0, canshuUrl.length - 1);
window.open("w_studentTrainResultNew.aspx?canshu=" + canshusub);
}
else {
alert("请选择需打印学员!");
}
}
function printStuTrainResult(ID, km, dno)
{
var TypeState = document.getElementById("hidTypeState").value;
var IfBlankPrint = ($("#ChbIfBlankPrint").attr("checked") == true) ? 0 : 1;
var href = "w_studentTrainResult.aspx?ID=" + ID + "&km=" + km + "&dno=" + dno + "&IfBlankPrint=" + IfBlankPrint + "&fun=0";
if (TypeState == "0")
{
//if (km != "1") {
window.open(href);
//window.location.href = "w_studentTrainResult.aspx?ID=" + ID + "&km=" + km + "&dno=" + dno + "&IfBlankPrint=" + IfBlankPrint + "&fun=0";
//} else
//{
// //alert("驾校用户没有打印科目一的权限!");
//}
}
else if (TypeState == "1") {
if (km == "1") {
window.open(href);
//window.location.href = "w_studentTrainResult.aspx?ID=" + ID + "&km=" + km + "&dno=" + dno + "&IfBlankPrint=" + IfBlankPrint + "&fun=0";
} else
{
if(km == "2")
{
alert("培训中心用户没有打印科目二的权限!");
}else
{
alert("培训中心用户没有打印科目三的权限!");
}
}
}
else
{
var R_Class = document.getElementById("hidR_Class").value;
if (R_Class != 0) {
alert("交管局用户没有打印权限!");
} else
{
window.open(href);
//window.location.href = "w_studentTrainResult.aspx?ID=" + ID + "&km=" + km + "&dno=" + dno + "&IfBlankPrint=" + IfBlankPrint + "&fun=0";
}
}
}
</script>
<script type="text/javascript">
function SelectAll(tempControl) {
var theBox = tempControl;
xState = theBox.checked;
elem = theBox.form.elements;
for (i = 0; i < elem.length; i++) {
if (elem[i].type == "checkbox" && elem[i].id != theBox.id) {
if (elem[i].checked != xState) {
elem[i].click();
}
}
}
$("#ChbIfBlankPrint").removeAttr("checked");
}
</script>
</head>
<body class="background_all">
<form id="Form1" method="post" runat="server">
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td valign="top" width="100%">
<table cellspacing="1" cellpadding="0" width="98%" align="center" border="0">
<tr>
<td bgcolor="#cccccc" height="23" width="70%">   学员管理 -- 证书记录打印 -- 学员培训记录
</td>
<td bgcolor="#cccccc" align="center" width="30%"> </td>
</tr>
<tr>
<td valign="top" colspan="2">
<asp:Panel ID="SearchPanel" runat="server" Width="100%" />
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tr>
<td class="td_border_all">
<table cellspacing="1" cellpadding="1" width="100%" align="center" border="0">
<tr>
<td class="td_bgcolor_all" align="center" colspan="4" height="22">学员查询</td>
</tr>
<tr>
<td class="BDTD">
<asp:Label runat="server" ID="lblTitle" Text="所属机构"></asp:Label>
</td>
<td class="WHITETD" colspan="3">
<asp:DropDownList ID="ddlDistrict" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlDistrict_SelectedIndexChanged">
</asp:DropDownList>
<asp:DropDownList ID="ddlTrainCenter" runat="server" AutoPostBack="True" Visible="false">
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="BDTD">所属驾校</td>
<td class="WHITETD">
<asp:DropDownList ID="ddlDrvNo" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlDrvNo_SelectedIndexChanged">
</asp:DropDownList>
</td>
<td class="BDTD">申请日期</td>
<td class="WHITETD">
<%--<asp:TextBox ID="BeginDate" runat="server" onclick="new Calendar().show(this);" Width="100px"></asp:TextBox>--%>
<input runat="server" readonly="readonly" id="BeginDate" onfocus="WdatePicker({Date:'%y-%M-{%d}'})" />
 至 
<input runat="server" readonly="readonly" id="EndDate" onfocus="WdatePicker({Date:'%y-%M-{%d}'})" />
<%--<asp:TextBox ID="EndDate" runat="server" onclick="new Calendar().show(this);" Width="100px"></asp:TextBox>--%>
</td>
</tr>
<tr>
<td class="BDTD" width="15%">学员编号</td>
<td class="WHITETD" width="35%">
<asp:TextBox ID="txtS_No" runat="server" Width="160px"></asp:TextBox>
</td>
<td class="BDTD" width="15%">学员姓名</td>
<td class="WHITETD" width="35%">
<asp:TextBox ID="txtS_Name" runat="server" Width="100px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="BDTD">学员状态</td>
<td class="WHITETD">
<asp:DropDownList ID="ddlS_Status" runat="server">
</asp:DropDownList>
</td>
<td class="BDTD">学车类型</td>
<td class="WHITETD">
<asp:DropDownList ID="ddlS_StudyVehicleType" runat="server">
<asp:ListItem Value=" "></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="BDTD">证件类型</td>
<td class="WHITETD">
<asp:DropDownList ID="ddlS_PaType" runat="server">
</asp:DropDownList>
</td>
<td class="BDTD">证件号</td>
<td class="WHITETD">
<asp:TextBox ID="txtS_IDCardNo" runat="server" Width="160px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="BDTD">科目</td>
<td class="WHITETD">
<asp:DropDownList ID="ddlSubject" runat="server">
<%--<asp:ListItem Value="0">所有</asp:ListItem>
<asp:ListItem Value="科目一">科目一</asp:ListItem>
<asp:ListItem Value="科目二">科目二</asp:ListItem>
<asp:ListItem Value="科目三">科目三</asp:ListItem>--%>
</asp:DropDownList>
</td>
<td class="BDTD">打印状态</td>
<td class="WHITETD">
<asp:DropDownList ID="ddlPrint" runat="server">
<asp:ListItem Value="0">未打印</asp:ListItem>
<asp:ListItem Value="1">已打印</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr bgcolor="#cccccc">
<td align="center" colspan="4" height="30">
<asp:Button ID="Button1" runat="server" Width="60PX" Text="搜索" Height="22px" Font-Size="12px" OnClick="Button1_Click"></asp:Button>
 <asp:Button ID="Button2" runat="server" Width="60px" Text="返回" Height="22px" Font-Size="12px" OnClick="Button2_Click"></asp:Button>
<asp:HiddenField ID="hidTypeState" runat="server" />
<asp:HiddenField ID="hidR_Class" runat="server" />
<%--<br />
<br />
培训单位签名(科目一):<asp:TextBox ID="txtTrainSign0" runat="server" Width="150px"></asp:TextBox>
  培训单位签名(科目二):<asp:TextBox ID="txtTrainSign1" runat="server" Width="150px"></asp:TextBox>
  培训单位签名(科目三):<asp:TextBox ID="txtTrainSign2" runat="server" Width="150px"></asp:TextBox>
 <br />
<%-- 管理机构签名(科目一):<asp:TextBox ID="txtGOVSign0" runat="server" Width="150px"></asp:TextBox>
  管理机构签名(科目二):<asp:TextBox ID="txtGOVSign1" runat="server" Width="150px"></asp:TextBox>
  管理机构签名(科目三):<asp:TextBox ID="txtGOVSign2" runat="server" Width="150px"></asp:TextBox>
 <br /> --%>
<%--签名日期(科目一):<asp:TextBox ID="txtSignDate0" runat="server" onclick="new Calendar().show(this);" Width="100px"></asp:TextBox>
  签名日期(科目二):<asp:TextBox ID="txtSignDate1" runat="server" onclick="new Calendar().show(this);" Width="100px"></asp:TextBox>
  签名日期(科目三):<asp:TextBox ID="txtSignDate2" runat="server" onclick="new Calendar().show(this);" Width="100px"></asp:TextBox>
 
<asp:Button ID="btnSaveDate" runat="server" Font-Size="12px" Height="22px"
onclick="btnSaveDate_Click" Text="保存" Width="60PX" />--%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="pBlankPrint" runat="server">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#cccccc">
<td align="right" height="25px">
<%--<asp:CheckBox ID="ChbIfBlankPrint" AutoPostBack="true" runat="server" Text="全打" />--%>
<input id="ChbIfBlankPrint" type="checkbox" /><label for="ChbIfBlankPrint">全打</label>
<input id="btnPrint" runat="server" type="button" onclick="PrintUrl();" value="批量打印" />
<%--<asp:Button ID="btnPrint" runat="server" OnClick="btnPrint_Click" Text="批量打印" />--%>
     
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="ResultPanel" runat="server" Width="100%">
<table cellspacing="1" cellpadding="1" width="100%" align="center" border="0">
<tr>
<td align="center">
<asp:DataGrid ID="DataGrid1" runat="Server" Width="100%" CssClass="grid_border_all" BorderWidth="1px"
PageSize="15" AutoGenerateColumns="False" BackColor="White" OnItemDataBound="DataGrid1_ItemDataBound">
<AlternatingItemStyle BackColor="#F7F7F7"></AlternatingItemStyle>
<ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
<HeaderStyle HorizontalAlign="Center" Height="22px" ForeColor="White" VerticalAlign="Middle"
CssClass="gird_bgcolor_all"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="序号">
<ItemTemplate>
<%# Container.ItemIndex + 1%>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="D_Name" HeaderText="驾校简称"></asp:BoundColumn>
<asp:BoundColumn DataField="Subject" HeaderText="科目"></asp:BoundColumn>
<asp:BoundColumn DataField="S_No" HeaderText="学员编号"></asp:BoundColumn>
<asp:BoundColumn DataField="S_Name" HeaderText="学员姓名"></asp:BoundColumn>
<%--<asp:BoundColumn DataField="S_Type" HeaderText="学员类型"></asp:BoundColumn>--%>
<asp:BoundColumn DataField="S_Sex" HeaderText="性别"></asp:BoundColumn>
<asp:BoundColumn DataField="S_Tel" HeaderText="联系电话"></asp:BoundColumn>
<asp:BoundColumn DataField="S_PaType" HeaderText="证件类型"></asp:BoundColumn>
<asp:BoundColumn DataField="S_IDCardNo" HeaderText="证件号"></asp:BoundColumn>
<asp:BoundColumn DataField="S_StudyVehicleType" HeaderText="学车类型"></asp:BoundColumn>
<asp:BoundColumn DataField="AddTime" DataFormatString="{0:d}" HeaderText="申请日期"></asp:BoundColumn>
<asp:BoundColumn DataField="S_Teacher" HeaderText="所属教练"></asp:BoundColumn>
<asp:BoundColumn DataField="S_Status" HeaderText="学员状态"></asp:BoundColumn>
<asp:BoundColumn HeaderText="打印次数" DataField="PrintCount"></asp:BoundColumn>
<%-- <asp:TemplateColumn HeaderText="查看">
<ItemTemplate>
<a target="_blank" style="color: Blue;" href='w_studentTrainResult.aspx?ID=<%# (DataBinder.Eval(Container,"DataItem.ID"))%>&km=<%# (DataBinder.Eval(Container,"DataItem.subjectid"))%>&dno=<%# (DataBinder.Eval(Container,"DataItem.d_no"))%>&IfBlankPrint=<%=IfBlankPrint.ToString()%>&fun=0'>
培训记录</a>
</ItemTemplate>
</asp:TemplateColumn>--%>
<asp:TemplateColumn HeaderText="查看">
<ItemTemplate>
<a style="color: Blue; cursor: pointer;" onclick="printStuTrainResult(<%# (DataBinder.Eval(Container,"DataItem.ID"))%>,<%# (DataBinder.Eval(Container,"DataItem.subjectid"))%>,'<%# (DataBinder.Eval(Container,"DataItem.d_no"))%>')">培训记录</a>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="选择">
<HeaderTemplate>
<asp:CheckBox ID="check1" runat="server"
onclick="javascript:SelectAll(this);" />
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lbid" runat="server"
Text='<%# DataBinder.Eval(Container,"DataItem.ID")%>' Visible="False"></asp:Label>
<asp:Label ID="lbSubject" runat="server"
Text='<%# DataBinder.Eval(Container,"DataItem.subjectid")%>' Visible="False"></asp:Label>
<asp:Label ID="lbD_No" runat="server"
Text='<%# DataBinder.Eval(Container,"DataItem.d_no")%>' Visible="False"></asp:Label>
<input id="CheckSingle" type="checkbox" name="<%#DataGrid1.ClientID%>_CheckSingle" />
<%--<asp:CheckBox ID="CheckSingle" Runat="server" />--%>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC" align="right">
<asp:LinkButton ID="lbFirst" runat="server" OnClick="lbFirst_Click" Enabled="false">首页</asp:LinkButton>
<asp:LinkButton ID="lbBack" runat="server" OnClick="lbBack_Click" Enabled="false">上一页</asp:LinkButton>
<asp:LinkButton ID="lbNext" runat="server" OnClick="lbNext_Click" Enabled="false">下一页</asp:LinkButton>
<asp:LinkButton ID="lbLast" runat="server" OnClick="lbLast_Click" Enabled="false">末页</asp:LinkButton>  
第<asp:DropDownList ID="ddlPageSelect" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlPageSelect_SelectedIndexChanged">
<asp:ListItem Value="1">1/1</asp:ListItem>
</asp:DropDownList>
页   共有<asp:Label ID="lbTotal" runat="server"></asp:Label>个记录  
每页<input id="tbPageSize" runat="server" style="width: 35px;" value="15" />个记录
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
</table>
</td>
<!--td width="13" background="../Images/Default_20.gif"></td-->
</tr>
</table>
</form>
</body>
</html>

2、打印页面(前台)

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="w_studentTrainResultNew.aspx.cs" Inherits="DTMIS.Web.StudentMG.w_studentTrainResultNew" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<style type="text/css">
.btnStyle {
display: none;
}
</style>
<script type="text/javascript" src="../js/LodopFuncs.js"></script>
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
height="0">
<embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0" pluginspage="../js/install_lodop.exe"></embed>
</object>
<title></title>
<script type="text/javascript"> var LODOP; //声明为全局变量
function myShow4() { LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
LODOP.PRINT_INITA(0, 0, 1123, 756, "重庆驾培学员培训记录打印");
LODOP.SET_PRINT_PAGESIZE(2, 2100, 2970, "A4"); LODOP.SET_SHOW_MODE("HIDE_PAPER_BOARD", 1); //隐藏背景条文
LODOP.SET_SHOW_MODE("HIDE_SBUTTIN_PREVIEW", 1);
//LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1); //注:"BKIMG_IN_PREVIEW"-预览包含背景图 "BKIMG_IN_FIRSTPAGE"- 仅首页包含背景图 var count = <%= prinCount%> ;
for (var i = 1; i <= count; i++) {
if(i!=count)
{
LODOP.ADD_PRINT_HTM(0, -10, 1000, 900, document.getElementById("div"+i).innerHTML);
LODOP.NewPage();
}
else {
LODOP.ADD_PRINT_HTM(0, -10, 1000, 900, document.getElementById("div"+i).innerHTML);
}
} var result = LODOP.PREVIEW();
if (result > 0) {
DTMIS.Web.StudentMG.w_studentTrainResultNew.UpdatePrintStatus();
window.close();
}
else {
if (window.confirm("未检测到打印信号,如果你已经打印,请点确认更新打印状态")) {
DTMIS.Web.StudentMG.w_studentTrainResultNew.UpdatePrintStatus(); }
window.close();
}
}; </script>
</head>
<body>
<form id="form1" runat="server">
<div style="width:100%; height:100%; text-align:center;">
<div id="div_PrintDown">
<input id="btn_Print" type="button" value="打印预览" name="B3" onclick="myShow4()" />
</br> <a href="../js/print.rar">打印插件包下载</a>
</div>
</div>
<div style="display: none;"><%= div_data.ToString() %></div> </form>
</body>
</html>

3、后台(套打、全打)

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="w_studentTrainResultNew.aspx.cs" Inherits="DTMIS.Web.StudentMG.w_studentTrainResultNew" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<style type="text/css">
.btnStyle {
display: none;
}
</style>
<script type="text/javascript" src="../js/LodopFuncs.js"></script>
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
height="0">
<embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0" pluginspage="../js/install_lodop.exe"></embed>
</object>
<title></title>
<script type="text/javascript"> var LODOP; //声明为全局变量
function myShow4() { LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
LODOP.PRINT_INITA(0, 0, 1123, 756, "重庆驾培学员培训记录打印");
LODOP.SET_PRINT_PAGESIZE(2, 2100, 2970, "A4"); LODOP.SET_SHOW_MODE("HIDE_PAPER_BOARD", 1); //隐藏背景条文
LODOP.SET_SHOW_MODE("HIDE_SBUTTIN_PREVIEW", 1);
//LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1); //注:"BKIMG_IN_PREVIEW"-预览包含背景图 "BKIMG_IN_FIRSTPAGE"- 仅首页包含背景图 var count = <%= prinCount%> ;
for (var i = 1; i <= count; i++) {
if(i!=count)
{
LODOP.ADD_PRINT_HTM(0, -10, 1000, 900, document.getElementById("div"+i).innerHTML);
LODOP.NewPage();
}
else {
LODOP.ADD_PRINT_HTM(0, -10, 1000, 900, document.getElementById("div"+i).innerHTML);
}
} var result = LODOP.PREVIEW();
if (result > 0) {
DTMIS.Web.StudentMG.w_studentTrainResultNew.UpdatePrintStatus();
window.close();
}
else {
if (window.confirm("未检测到打印信号,如果你已经打印,请点确认更新打印状态")) {
DTMIS.Web.StudentMG.w_studentTrainResultNew.UpdatePrintStatus(); }
window.close();
}
}; </script>
</head>
<body>
<form id="form1" runat="server">
<div style="width:100%; height:100%; text-align:center;">
<div id="div_PrintDown">
<input id="btn_Print" type="button" value="打印预览" name="B3" onclick="myShow4()" />
</br> <a href="../js/print.rar">打印插件包下载</a>
</div>
</div>
<div style="display: none;"><%= div_data.ToString() %></div> </form>
</body>
</html>

(不使用全打、套打)

using AjaxPro;
using DTMIS.BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls; namespace DTMIS.Web.StudentMG
{
public partial class CertificatePrintNew : System.Web.UI.Page
{
protected StringBuilder div_data = new StringBuilder();
protected int prinCount = 0;
public static string stuidStr = ""; //学员ID字符串,用于批量修改打印次数 public static int iStudentID;//学员编号
public string S_GraduateNo;//资格证号
public string S_Name;//姓名
public string S_Sex;//性别
public DateTime S_RegisterDate;//报名日期
public string S_Pic;//照片
public string S_StudyVehicleType;//准驾车型
public string D_Name;//驾校
protected string sRegYear;
protected string sRegMonth;
protected string sRegDay; protected string gRYear;
protected string gRMonth;
protected string gRDay; protected string sPrintYear;
protected string sPrintMonth;
protected string sPrintDay;
protected string bgpath;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Utility.RegisterTypeForAjax(typeof(CertificatePrintNew));
} #region 批量打印执行程序
MorePrin();
#endregion
}
private void MorePrin()
{
string canshu = Request.QueryString["canshu"];
stuidStr = canshu;
string[] allstudent = canshu.Split(',');
this.prinCount = allstudent.Length;
for (int i = 0; i < allstudent.Length; i++)
{
DataSet set = BLL.T_Student_Base.getStudentData(Convert.ToInt32(allstudent[i]));
if (set.Tables.Count > 0)
{
foreach (DataRow item in set.Tables[0].Rows)
{
DateTime time;
DateTime time1;
S_GraduateNo = item["S_GraduateNo"].ToString().Trim();
S_Name = item["S_Name"].ToString().Trim();
S_Sex = item["S_Sex"].ToString().Trim();
S_Pic = ConvertUrl(item["S_Pic"].ToString().Trim());
S_StudyVehicleType = item["S_StudyVehicleType"].ToString().Trim();
D_Name = item["D_Name"].ToString();
//报名日期
if (item["S_RegisterDate"].ToString() != "")
{
time = Convert.ToDateTime(item["S_RegisterDate"].ToString().Trim());
sRegYear = time.Year.ToString();
sRegMonth = time.Month.ToString();
sRegDay = time.Day.ToString();
}
//结业日期
if (item["A_AddTime"].ToString() != "")
{
time1 = Convert.ToDateTime(item["A_AddTime"].ToString().Trim());
gRYear = time1.Year.ToString();
gRMonth = time1.Month.ToString();
gRDay = time1.Day.ToString();
}
//打印时间
DateTime now = DateTime.Now;
sPrintYear = now.Year.ToString();
sPrintMonth = now.Month.ToString();
sPrintDay = now.Day.ToString();
}
}
#region 构建div
bgpath = "<img border='0' src='../Images/001.jpg' />";
//div_data.Append("<div id=\"div" + (i + 1) + "\" style=\"position:relative;\">" + bgpath); //背景图片
div_data.Append("<div id=\"div" + (i + 1) + "\" style=\"position:relative;\">"); //背景图片
div_data.Append("<span style=\"position:absolute; top:85px; left:80px;width:280px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + S_GraduateNo + "</span>"); //证件编号
//div_data.Append("<img style=\"position:absolute; top:100px; left:400px;\" border='0' src='" + S_Pic + "' width='114' height='149' />"); //照片
div_data.Append("<span style=\"position:absolute; top:165px; left:60px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + S_Name + "</span>"); //学员名称
div_data.Append("<span style=\"position:absolute; top:165px; left:170px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + S_Sex + "</span>"); //性别
div_data.Append("<span style=\"position:absolute; top:190px; left:250px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + S_StudyVehicleType + "</span>"); //准驾车型 div_data.Append("<span style=\"position:absolute; top:165px; left: 235px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + sRegYear + "</span>"); //报名时间(年)
div_data.Append("<span style=\"position:absolute; top:165px; left:315px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + sRegMonth + "</span>"); //报报名时间(月)
div_data.Append("<span style=\"position:absolute; top:165px; left:355px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + sRegDay + "</span>"); //报名时间(日) div_data.Append("<span style=\"position:absolute; top:190px; left:30px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + gRYear + "</span>"); //结业时间(年)
div_data.Append("<span style=\"position:absolute; top:190px; left:98px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + gRMonth + "</span>"); //结业时间(月)
div_data.Append("<span style=\"position:absolute; top:190px; left:140px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + gRDay + "</span>"); //结业时间(日) div_data.Append("<span style=\"position:absolute; top:265px; left:220px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + sPrintYear + "</span>"); //打印时间(年)
div_data.Append("<span style=\"position:absolute; top:265px; left: 300px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + sPrintMonth + "</span>"); //打印时间(月)
div_data.Append("<span style=\"position:absolute; top:265px; left: 353px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + sPrintDay + "</span>"); //打印时间(日) div_data.Append("<span style=\"position:absolute; top:240px; left:250px; width:400px;height:50px; font-family:楷体;font-weight:bold; font-size:18px;\">" + D_Name + "</span>"); //培训机构 div_data.Append(" </div>");
#endregion
if (prinCount == (i + 1)) //全部打印完成后,移除Session保存的值
{
ClientScript.RegisterStartupScript(this.GetType(), "print", "<script>myShow4();</script>");
Session.Remove("canshu");
}
} }
//[AjaxMethod]
[WebMethod]
public static string UpdatePrintStatus(string stulist)
{
string msg = string.Empty;
int result= Common.Update("T_Student_Base", "IsGraducatePrint=1", "ID in(" + stulist + ")");
if (result > 0)
{
msg = "ok";
}
else {
msg = "error";
}
return msg;
}
private string ConvertUrl(string imgUrl)
{
if (!string.IsNullOrEmpty(imgUrl))
{
imgUrl = imgUrl.Substring(1, imgUrl.Length - 1);
string strDomain = "http://" + HttpContext.Current.Request.Url.Host;
int iPort = HttpContext.Current.Request.Url.Port;
string imgPath = strDomain + ":" + iPort.ToString() + "/" +
imgUrl.Replace(Server.MapPath("/"), "").Replace(@"\", "/"); return imgPath;
}
else
{
return "";
}
}
}
}

asp.net Lodop实现批量打印的更多相关文章

  1. vue项目中使用Lodop实现批量打印html页面和pdf文件

    1.Lodop是什么? Lodop(标音:劳道谱,俗称:露肚皮)是专业WEB控件,用它既可裁剪输出页面内容,又可用程序代码直接实现复杂打印.控件功能强大,却简单易用,所有调用如同JavaScript扩 ...

  2. asp.net lodop单个打印

    1.首先在列表页面增加以下代码 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind=&quo ...

  3. LODOP批量打印多页模版进行维护

    批量打印的时候,可以循环多任务,也可以循环多页,很多的时候也可以分页分任务,分组打印.如果是一个任务里的多页相同的模版,一个任务中会有很多打印项,这些打印项在每页中的位置是相同的,如果要调整,调整结果 ...

  4. LODOP打印控件进行批量打印

    Lodop打印控件批量打印的方式:1.批量打印每页内容相同的:(1)批量打印相同内容的很多纸张,可以设置打印份数,把该内容打印出多份.2.批量打印每页不同内容的:(1)通过在一个任务中分页,循环添加页 ...

  5. 利用lodop打印控件轻松实现批量打印 (转载http://www.thinkphp.cn/topic/13085.html)

    最近在做一个打印程序,要实现批量打印功能,在网上找了很多天,也在tp官网咨询大牛们,对大家的的提议我一一进行了研究,总结如下: 要实现批量打印可以有两个办法: 一是利用专业的报表程序,能实现十分复杂的 ...

  6. 一个由正则表达式引发的血案 vs2017使用rdlc实现批量打印 vs2017使用rdlc [asp.net core 源码分析] 01 - Session SignalR sql for xml path用法 MemCahe C# 操作Excel图形——绘制、读取、隐藏、删除图形 IOC,DIP,DI,IoC容器

    1. 血案由来 近期我在为Lazada卖家中心做一个自助注册的项目,其中的shop name校验规则较为复杂,要求:1. 英文字母大小写2. 数字3. 越南文4. 一些特殊字符,如“&”,“- ...

  7. VS2012报表(RDLC)系列应用之单据批量打印

    一.前言 最近做的项目需要单据批量打印的功能,优先想到用RDLC来实现.经过Visual Studio几个版本的发展后,RDLC愈发成熟,操作方式也变得简洁,相比vs2005的版本,有质的提升,不过仍 ...

  8. ArcGIS中国工具应用:固定比例尺固定纸张批量打印

    ArcGIS中国工具应用:固定比例尺固定纸张批量打印 下载地址:http://files.cnblogs.com/files/gisoracle/a3batchprint.zip 固定A3,比例尺1: ...

  9. (转: daifubing的博客 )Delphi二维码中文支持、分组、批量打印经验小结

    一直也没接触到什么复杂的报表,都是一些简单的报表,在DelphI下使用QuickReport一般也就能满足需要了,由于公司现在需求的变化,对条码扫描提出了新的要求,主要是扫码要包含更多地内容,以前的一 ...

随机推荐

  1. Good Bye 2015 D. New Year and Ancient Prophecy

    D. New Year and Ancient Prophecy time limit per test 2.5 seconds memory limit per test 512 megabytes ...

  2. 轮廓线DP POJ3254 && BZOJ 1087

    补了一发轮廓线DP,发现完全没有必要从右往左设置状态,自然一点: 5 6 7 8 9 1 2 3 4 如此设置轮廓线标号,转移的时候直接把当前j位改成0或者1就行了.注意多记录些信息对简化代码是很有帮 ...

  3. gerrit add review标签

    添加verifyed标签 http://blog.csdn.net/terence427/article/details/16840697

  4. DataGridView

    一.实现CheckBox列. 1.1 增加CheckBox列: 在DataGridView中增加CheckBox列: 注意:设置ColumnType类型和设置FalseValue为0,TrueValu ...

  5. Java线程中带有返回值的线程Callable

    在Java5之前,线程是没有返回值的,常常为了“有”返回值,破费周折,而且代码很不好写.或者干脆绕过这道坎,走别的路了.现在Java终于有可返回值的任务(也可以叫做线程)了. 可返回值的任务必须实现C ...

  6. postgresql常用命令

    1.createdb 数据库名称 产生数据库2.dropdb 数据库名称 删除数据库 3.CREATE USER 用户名称 创建用户4.drop User 用户名称 删除用户 5.SELECT use ...

  7. 学习C语言感悟

     还记得刚上第一节C语言课的时候,基本上一节课只有最后10分钟的内容听懂了.在此之前从没接触过C语言,想说看看书预习一下吧,可是完全找不到条理,发现老师也不是按书上的顺序讲的.当时就特别着急,想说难道 ...

  8. python学习之函数

    1.函数名可以被赋值 比如: def aaa(): pass b = aaa//将函数名字赋值给b b()//跟aaa()效果一样 2.return 2.1.如果函数不写return的话,会默认返回N ...

  9. C#可空类型的速度和GC Alloc测试

    在Unity中进行速度和GC Alloc的测试 测试脚本: using UnityEngine; using System; using System.Collections; using Syste ...

  10. windows 7系统下出现某盘回收站损坏解决办法

    今天遇到一个从没有遇见的问题,就是领导说他的回收站损坏了,要我去看下,我一开始也没用辙,网上搜了很多,说在命令提示符里面修改,我试了不行,后来我这样做就好了:1.打开计算机 2.找到工具选项,单击选择 ...