asp.net采用DCOM连接打印报表Fastreport
2011-07-27 11:55
369 查看
脚本:
<body onkeydown="next();">
<form id="form1" runat="server">
<input id="serverinfo" type="hidden" runat="server" value="" />
<OBJECT ID="uprint" CLASSID="CLSID:7D79186A-EA0D-49F9-B104-E7AE9DA1B7FB" width="0" height="0" CODEBASE="../Report/uprintct.CAB#version=1,2,0,1"></OBJECT>
<div id="div1" runat="server">
..................
<input type="button" onclick="print('','CashTranDtl.fr3');" class="button_bak" value="打 印" style="margin-left:100px " />
........
传送打印参数过程:
<script language="javascript" type="text/javascript">
function $(obj)
{
return document.getElementById(obj);
}
function print(billctl,reportname)
{
var servername;
var userid;
var password;
var bill_no;
var dbname;
servername= $('serverinfo').value.split(';')[0];
userid= $('serverinfo').value.split(';')[1];
password= $('serverinfo').value.split(';')[2];
dbname =$('serverinfo').value.split(';')[3];
if (billctl!='')
{
bill_no = $(billctl).value;
}
else
{
bill_no =$('serverinfo').value.split(';')[4];
}
$('uprint').openrpt(servername,userid,password,dbname,reportname,bill_no);
}
</script>
启动连接数据库参数:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
serverinfo.Value = System.Configuration.ConfigurationManager.AppSettings["servername"] + ";" + System.Configuration.ConfigurationManager.AppSettings["userid"] + ";"
+ System.Configuration.ConfigurationManager.AppSettings["password"] + ";" + System.Configuration.ConfigurationManager.AppSettings["dbname"] + ";" + Session["userno"].ToString() + "-" + Environment.MachineName.ToString();
}
}
<body onkeydown="next();">
<form id="form1" runat="server">
<input id="serverinfo" type="hidden" runat="server" value="" />
<OBJECT ID="uprint" CLASSID="CLSID:7D79186A-EA0D-49F9-B104-E7AE9DA1B7FB" width="0" height="0" CODEBASE="../Report/uprintct.CAB#version=1,2,0,1"></OBJECT>
<div id="div1" runat="server">
..................
<input type="button" onclick="print('','CashTranDtl.fr3');" class="button_bak" value="打 印" style="margin-left:100px " />
........
传送打印参数过程:
<script language="javascript" type="text/javascript">
function $(obj)
{
return document.getElementById(obj);
}
function print(billctl,reportname)
{
var servername;
var userid;
var password;
var bill_no;
var dbname;
servername= $('serverinfo').value.split(';')[0];
userid= $('serverinfo').value.split(';')[1];
password= $('serverinfo').value.split(';')[2];
dbname =$('serverinfo').value.split(';')[3];
if (billctl!='')
{
bill_no = $(billctl).value;
}
else
{
bill_no =$('serverinfo').value.split(';')[4];
}
$('uprint').openrpt(servername,userid,password,dbname,reportname,bill_no);
}
</script>
启动连接数据库参数:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
serverinfo.Value = System.Configuration.ConfigurationManager.AppSettings["servername"] + ";" + System.Configuration.ConfigurationManager.AppSettings["userid"] + ";"
+ System.Configuration.ConfigurationManager.AppSettings["password"] + ";" + System.Configuration.ConfigurationManager.AppSettings["dbname"] + ";" + Session["userno"].ToString() + "-" + Environment.MachineName.ToString();
}
}
相关文章推荐
- asp.net连接打印报表Grid+Report5.0
- ASP.NET 2.0 打印 RDLC报表
- c#asp.net表格Html数据模板转换Pdf文件web打印pdf报表dll
- [转]ASP.NET水晶报表打印常用设置
- ASP.NET 水晶报表打印功能实现代码
- .NET 打印水晶报表(CrystalReport)时,出现“查询引擎错误 C:/DOCUME~1/wt/ASPNET/LOCALS~1/Temp/temp_bd09398e-5eb7-4ca5-a8ee-6ebf63581d18.rpt"
- [转]ASP.NET水晶报表打印常用设置
- [转]ASP.NET水晶报表打印常用设置
- asp.net 打印控件之报表
- asp.net中如何打印ReportViewer报表
- ASP.NET 水晶报表打印功能实现代码
- 蛙蛙推荐:asp.net和水晶报表实现套表打印
- ASP.NET里实现水晶报表的打印
- ASP.NET水晶报表实现打印功能
- ASP.NET访问远程服务器RDCL报表文件打印问题
- ASP.NET中应用XML技术实现Web报表打印
- asp.net 打印ReportViewer报表 rdlc报表
- ASP.NET中的可更新数据的打印报表(前后台设置与存储过程)
- asp.net 打印ReportViewer报表 rdlc报表
- ASP.NET MVC调用Delphi开发的Web报表打印activex组件