asp.net lodop单个打印
1、首先在列表页面增加以下代码
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CertificateSearch.aspx.cs" Inherits="DTMIS.Web.StudentMG.CertificateSearch" %> <!DOCTYPE html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
<title>StudentSearch</title> <script src="../js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="../js/My97DatePicker/WdatePicker.js"></script>
<link href="../Include/StyleFile.css" type="text/css" rel="stylesheet">
<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();
}
}
}
}
function changecolor(cbo, o) {
var theBox = cbo;
var tr = document.getElementById(o);
if (theBox.checked) {
tr.style.backgroundColor = "#E0E0E0";
}
else {
tr.style.backgroundColor = "Transparent"; }
}
//批量打印
function PrintUrl() { var canshu = "<%= canshu%>";
var canshuUrl = "";
var canshus = canshu.split('|');
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] + ",";
}
}
}
if (canshuUrl != "") {
var canshusub = canshuUrl.substr(0, canshuUrl.length - 1);
window.open("CertificatePrintNew.aspx?canshu=" + canshusub); }
else {
alert("请选择需打印学员!");
}
}
</script>
</head>
<body ms_positioning="GridLayout" bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0"
background="../Images/BackGround.gif">
<form id="Form1" method="post" runat="server">
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td valign="top" width="100%" background="../Images/BackGround.gif">
<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">
<br>
<asp:Panel ID="SearchPanel" runat="server" Width="100%">
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tr>
<td bgcolor="#006d4a">
<table cellspacing="1" cellpadding="1" width="100%" align="center" border="0">
<tr>
<td class="tr" align="center" colspan="4" height="22">
学员信息查询</td>
</tr>
<tr>
<td class="BDTD">
所属驾校</td>
<td class="WHITETD">
<asp:DropDownList ID="ddlDrvNo" runat="server">
</asp:DropDownList></td>
<td class="BDTD" width="15%">
学员姓名</td>
<td class="WHITETD" width="35%">
<asp:TextBox ID="txtS_Name" runat="server" Width="100px"></asp:TextBox></td>
<%-- <td class="WHITETD"> </td>--%>
</tr>
<tr>
<td class="BDTD">
证件号</td>
<td class="WHITETD">
<asp:TextBox ID="txtS_IDCardNo" runat="server" Width="160px"></asp:TextBox>
</td>
<td class="BDTD">报名日期</td>
<td class="WHITETD">
<input runat="server" readonly="readonly" id="BgDate" onfocus="WdatePicker({Date:'%y-%M-{%d}'})" /> 至
<input runat="server" readonly="readonly" id="EdDate" onfocus="WdatePicker({Date:'%y-%M-{%d}'})" />
</td>
</tr>
<tr>
<td class="BDTD">
打印状态</td>
<td class="WHITETD">
<asp:DropDownList ID="ddlPrintStatus" runat="server">
<asp:ListItem Value="">全部记录</asp:ListItem>
<asp:ListItem Value="1">已打印</asp:ListItem>
<asp:ListItem Selected="True" Value="0">未打印</asp:ListItem>
</asp:DropDownList>
</td>
<td class="BDTD">
</td>
<td class="WHITETD">
</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="ddlAuditStatus" runat="server">
<asp:ListItem Selected="True"> </asp:ListItem>
<asp:ListItem>通过</asp:ListItem>
<asp:ListItem>未通过</asp:ListItem>
<asp:ListItem>未审核</asp:ListItem>
</asp:DropDownList>
</td>
<td class="BDTD">
批量编号</td>
<td class="WHITETD">
<asp:DropDownList ID="ddlS_Batch" runat="server" Enabled="false">
</asp:DropDownList></td>
</tr>--%>
<%-- <tr>
<td class="BDTD">
证件类型</td>
<td class="WHITETD">
<asp:DropDownList ID="ddlPaType" runat="server">
</asp:DropDownList>
</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 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="Button5" runat="server" Font-Size="12px" Height="22px"
Text="导出" Width="60PX" onclick="Button5_Click" />--%>
</td>
</tr>
<tr>
<td colspan="4" height="30" >
<input id="btnPrint" runat="server" type="button" onclick="PrintUrl();" value="批量打印" style="float:right;" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
<%-- <asp:Panel ID="pAudit" Width="100%" runat="server">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#cccccc">
<td align="right" height="25px">
审批操作: <asp:DropDownList ID="ddlAudit" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlAudit_SelectedIndexChanged">
<asp:ListItem Selected="True"> </asp:ListItem>
<asp:ListItem>通过</asp:ListItem>
<asp:ListItem>未通过</asp:ListItem>
</asp:DropDownList>
</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%"
BorderColor="#006D4A" BorderWidth="1px" PageSize="15"
AutoGenerateColumns="False" OnItemDataBound="DataGrid1_ItemDataBound" >
<AlternatingItemStyle BackColor="#F7F7F7"></AlternatingItemStyle>
<ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
<HeaderStyle HorizontalAlign="Center" Height="22px" ForeColor="White" VerticalAlign="Middle"
BackColor="#006D4A"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="序号" ItemStyle-Width="6%">
<ItemTemplate><%# Container.ItemIndex + 1%></ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="D_Name" HeaderText=" 所属驾校" ItemStyle-Width="7%"></asp:BoundColumn>
<%-- <asp:BoundColumn DataField="RS_Name" HeaderText="招生点" ItemStyle-Width="7%" Visible="False"></asp:BoundColumn>--%>
<%-- <asp:BoundColumn DataField="S_No" HeaderText="学员编号" ItemStyle-Width="7%"></asp:BoundColumn>--%>
<asp:BoundColumn DataField="S_Name" HeaderText="学员姓名" ItemStyle-Width="7%"></asp:BoundColumn>
<%-- <asp:BoundColumn DataField="S_PaType" HeaderText="证件类型" ItemStyle-Width="7%"></asp:BoundColumn>--%>
<asp:BoundColumn DataField="S_IDCardNo" HeaderText="证件号" ItemStyle-Width="7%"></asp:BoundColumn>
<%--<asp:BoundColumn DataField="S_Tel" HeaderText="联系电话" ItemStyle-Width="7%"></asp:BoundColumn>--%>
<asp:BoundColumn DataField="S_StudyVehicleType" HeaderText="学车类型" ItemStyle-Width="7%"></asp:BoundColumn>
<%--<asp:BoundColumn DataField="S_ContractNo" HeaderText="合同编号"></asp:BoundColumn>--%>
<asp:BoundColumn DataField="S_RegisterDate" HeaderText="报名日期" ItemStyle-Width="7%" DataFormatString="{0:yyyy-MM-dd}" ></asp:BoundColumn>
<%--<asp:BoundColumn DataField="S_ActiveTime" HeaderText="激活日期" ItemStyle-Width="7%"></asp:BoundColumn>--%>
<%--<asp:BoundColumn DataField="S_Status" HeaderText="学员状态" ItemStyle-Width="7%"></asp:BoundColumn>--%>
<%--<asp:BoundColumn DataField="S_Flag" HeaderText="审批状态" ItemStyle-Width="6%"></asp:BoundColumn>--%>
<%-- <asp:TemplateColumn HeaderText="学习进度" ItemStyle-Width="6%">
<ItemTemplate>
<a href='w_studentStudyResultYC.aspx?SNo=<%# (DataBinder.Eval(Container,"DataItem.S_No"))%>'>学习进度</a>
</ItemTemplate>
</asp:TemplateColumn>--%> <asp:TemplateColumn HeaderText="操作" ItemStyle-Width="6%">
<ItemTemplate>
<a target="_blank" style=" color:Blue;"href='CertificatePrint.aspx?ID=<%# (DataBinder.Eval(Container,"DataItem.ID"))%>'>结业证打印</a>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="选择" ItemStyle-Width="6%" >
<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>
<input id="CheckSingle" type="checkbox" name="<%#DataGrid1.ClientID%>_CheckSingle" /> </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>
</tr>
</table>
</form>
</body>
</html>
2、打印页面(前台)
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CertificatePrint.aspx.cs" Inherits="DTMIS.Web.StudentMG.CertificatePrint" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title></title>
<script src="../js/jquery-1.7.2.min.js"></script>
<script 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="install_lodop.exe"></embed>
</object>
<script>
function ClosePrintPage() {
window.opener = null;
window.open('', '_self', '');
window.close();
}
var LODOP; //声明为全局变量
function showPrint() {
var stuid = '<%=iStudentID%>';
CreatePage(); LODOP.SET_SHOW_MODE("BKIMG_IN_PREVIEW", 1); //注:"BKIMG_IN_PREVIEW"-预览包含背景图 "BKIMG_IN_FIRSTPAGE"- 仅首页包含背景图
LODOP.SET_SHOW_MODE("HIDE_SBUTTIN_PREVIEW", 1);
var printCount = LODOP.PREVIEW();
//LODOP.PRINT_DESIGN();
if (printCount > 0) {
//DTMIS.Web.StudentMG.w_studentGradPa.UpdatePrintStatus();
$.ajax({
type: "post",
url: "CertificatePrint.aspx/UpdatePrintStatus",
dataType: "json",
data: "{'stuid':" + stuid + "}",
contentType: "application/json;charsert=utf-8;",
success: function (data) {
}
});
}
ClosePrintPage();
}
function CreatePage() { LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "100%");//
//LODOP.PRINT_INITA(0, 0, 3800, 3600, "廊坊驾培结业证书打印");//参数说明:(距上,距左,打印区宽度,打印区高度)
LODOP.PRINT_INITA(0, 0, 1123, 756, "廊坊驾培结业证书打印");
LODOP.SET_PRINT_PAGESIZE(1, 1850, 2680, "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"- 仅首页包含背景图 //LODOP.ADD_PRINT_IMAGE(8, 15, 2000, 1760, "<img border='0' src='../Images/001.jpg' />");//设置背景图片
LODOP.ADD_PRINT_TEXT(85, 70, 280, 50, "<%=S_GraduateNo %>");//证件编号
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); //LODOP.ADD_PRINT_IMAGE(100, 400, 132, 185, "<img border='0' src='<%= S_Pic%>' />");//照片
LODOP.ADD_PRINT_TEXT(165, 55, 200, 50, "<%=S_Name %>");//学员名称
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(165, 165, 100, 50, "<%=S_Sex %>");//性别
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(190, 245, 100, 50, "<%=S_StudyVehicleType %>");//准驾车型
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(165, 230, 100, 50, "<%=sRegYear %>");//报名时间(年)
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(165, 310, 100, 50, "<%=sRegMonth %>");//报名时间(月)
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(165, 350, 100, 50, "<%=sRegDay %>");//报名时间(日)
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(190, 15, 100, 50, "<%=gRYear %>");//结业时间(年)
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(190, 88, 100, 50, "<%=gRMonth %>");//结业时间(月)
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(190, 130, 100, 50, "<%=gRDay %>");//结业时间(日)
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(240, 245, 500, 50, "<%=D_Name %>");//培训机构
LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(265, 215, 100, 50, "<%=sPrintYear %>");//打印时间(年)
LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(265, 295, 100, 50, "<%=sPrintMonth %>");//打印时间(月)
LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体"); LODOP.ADD_PRINT_TEXT(265, 348, 100, 50, "<%=sPrintDay %>");//打印时间(日)
LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "楷体");
} </script>
</head>
<body onload="showPrint()">
<form id="form1" style="margin: 0px; padding: 0px; text-align: left;" runat="server">
<div id="div_PrintDown">
<input type="button" value="打印预览" name="B3" onclick="showPrint()" />
</div> </form>
</body>
</html>
3、后台代码
using AjaxPro;
using DTMIS.BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls; namespace DTMIS.Web.StudentMG
{
public partial class CertificatePrint : System.Web.UI.Page
{ private string ModuleDir = "StudentMG/";
private string ModulePage = "CertificatePrint.aspx";
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 void Page_Load(object sender, EventArgs e)
{
//if (!Common.canAccess(this.ModuleDir + this.ModulePage))
//{
// base.Response.Redirect("../NoPower.html");
//}
if (!IsPostBack)
{
Utility.RegisterTypeForAjax(typeof(CertificatePrint));
iStudentID = Convert.ToInt32(base.Request.QueryString["ID"]); DataSet set = BLL.T_Student_Base.getStudentData(iStudentID); 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().Trim();
//报名日期
if (item["S_RegisterDate"].ToString() != "")
{
time = Convert.ToDateTime(item["S_RegisterDate"].ToString());
sRegYear = time.Year.ToString();
sRegMonth = time.Month.ToString();
sRegDay = time.Day.ToString();
}
//结业日期
if (item["A_AddTime"].ToString() != "")
{
time1 = Convert.ToDateTime(item["A_AddTime"].ToString());
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();
} } }
}
//[AjaxMethod]
[WebMethod]
public static string UpdatePrintStatus(string stuid)
{
string msg = string.Empty;
int result = Common.Update("T_Student_Base", "IsGraducatePrint=1", "ID=" + stuid);
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 "";
}
}
}
}
以上三步即可实现lodop打印
asp.net lodop单个打印的更多相关文章
- 在ASP.NET2.0里打印网页指定的内容(比如打印网页里的一个Table)
原文:在ASP.NET2.0里打印网页指定的内容(比如打印网页里的一个Table) 打印指定内容: <html> <head> <script type= " ...
- Lodop调整打印项输出顺序 覆盖与层级
Lodop中的打印项,如果有输出在同一位置,或部分位置重叠的地方,打印项之间是怎么覆盖的呢?在JS里,按照Lodop语句打印项先后的执行顺序,先执行的先输出,后执行的后输出,如果有后面的打印项和前面的 ...
- html页面提交JSON,ASP页面接收并打印
jsonSubmit.html 1)能过 javascript函数驱动请求页 <!DOCTYPE html> <html> <head> <title> ...
- asp.net Lodop实现批量打印
1.列表(前台) <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="w_stu ...
- LODOP中打印项水平居中简短问答
相关博文:LODOP打印项水平居中(超文本纯文本居中)LODOP打印超文本有边距不居中的情况2(超文本居中的一种) LODOP表格水平居中3(宽度为百分比)(超文本居中的一种) LODOP打印图片水平 ...
- asp.net 实现在线打印功能,jQuery打印插件PrintArea实现自动分页
使用的组件:jQuery打印插件PrintArea,有兴趣的可以研究一下. 使用方法略过,这里将介绍如何实现打印多页是可以分页. 现在提供两种方法思路: 1.根据特定的打印机型号和使用的纸张类型,然后 ...
- C# Lodop实现打印
项目的Debug文件夹下有个template文件夹,里面有用到的js.自己建的要打印的网页和用到的背景图 1.打印方法: class print { public void printzb(strin ...
- Lodop Web打印插件使用
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" st ...
- LODOP获取打印成功,是否加入队列
之前博文介绍过获取打印机状态码 LODOP获取打印机状态码和状态码含义测试,但是打印机种类千差万别,状态码不一定准确,特别是打印成功的状态码,获取任务不在队列,可以判断打印成功,删除任务也是任务不在队 ...
随机推荐
- Sublime一键预览
//chrome{ "keys": [ "f12" ], "command": "side_bar_files_open_with ...
- 使用宏命令撤销EXCEL工作表保护
EXCEL工作表编辑资料,设置了工作表保护后,不能对表格进行插入删除操作.如果没有密码,很简单:工具-选项—工作表保护——撤消工作表保护 就可以了.如果忘记密码,如下操作: 1. 打开文件 2. 工具 ...
- 手机APP功能测试经验分享2016.06.06
1.登录时,Android和IOS同样的操作,提示信息不一致: 2.注册等页面切换成横屏容易不兼容.把内存卡去掉,再发送图片.音频.视频容易出错. 3.Android和IOS同样的功能,同样的原型图, ...
- 马士兵Java视频教程 —— 学习顺序
第一部分:J2se学习视频内容包括: 尚学堂科技_马士兵_JAVA视频教程_JDK5.0_下载-安装-配置 尚学堂科技_马士兵_JAVA视频教程_J2SE_5.0_第01章_JAVA简介_源代码_及重 ...
- CountDownLatch和CyclicBarrier 举例详解
有时候会有这样的需求,多个线程同时工作,然后其中几个可以随意并发执行,但有一个线程需要等其他线程工作结束后,才能开始.举个例子,开启多个线程分块下载一个大文件,每个线程只下载固定的一截,最后由另外一个 ...
- [OSG]OSG例子程序简介
1.example_osganimate一)演示了路径动画的使用(AnimationPath.AnimationPathCallback),路径动画回调可以作用在Camera.CameraView.M ...
- greenDAO3 基本使用
greenDAO3基本使用 greenDAO3开始使用注解的方式定义实体类(entity),并且是通过安装gradle插件来生成代码.之前的版本则是通过建立一个独立的Java-lib工程来存放生成的文 ...
- IIS出现Service Unavailable 错误
IIS访问操作出现以下问题时要如何解决:
- 关于eclipse删除servers之后,不能新建其所对应版本的Servers
无法从以下方式,添加Tomcat服务器. 其中ServerName是被置为灰色的,无法编辑. 如何解决 1. 关闭Eclipse 2. 打开WorkSpace所在的位置. {workspa ...
- github 添加 SSH key
在 github 上添加 SSH key 的步骤: 1.首先需要检查你电脑是否已经有 SSH key 运行 git Bash 客户端,输入如下代码: $ cd ~/.ssh $ ls 这两个命令就是检 ...