Recently, a project using ReportViewer to render the report of the local RDLC module, users need to click at least three times to direct printing, users feel very poor usability, we need to modify.
Through the Internet to find relevant data, found that directly using ActiveX control RSClientPrint directly print the use of SQL Server Reporting Services, a lot of information, but also said more detailed, but did not print the relevant content of the local report, it seems only since the groping.
After studying information about printing SQL Server Reporting Services, especially this article: http://www.codeproject.com/KB/reporting-services/ Rsclientprint.aspx, let's write a simple HTML file to test:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title></title>
<body onload= "Print ()" >
<object id= "RSClientPrint"
Classid= "clsid:5554dcb0-700b-498d-9b58-4e40e5814405" codebase= "/rsclientprint-x86.cab" VIEWASTEXT></OBJECT >
<script type= "Text/javascript" language= "JavaScript" >
function Print (oid,name) {
if (typeof rsclientprint.print = = "undefined") {
Alert ("Unable to load client print control.");
Return
}
Rsclientprint.marginleft = 0;
rsclientprint.margintop = 0;
rsclientprint.marginright = 0;
Rsclientprint.marginbottom = 0;
Rsclientprint.pageheight = 296.926;
Rsclientprint.pagewidth = 210.058;
Rsclientprint.culture = 2052;
Rsclientprint.uiculture = 2052;
Rsclientprint.usesinglerequest = true;
Rsclientprint.useemfplus = true;
Rsclientprint.print ("Http://localhost:2940/JDCJY/ReportHandler.ashx", "oid=" +escape (OID) + "&name=" +escape ( Name), "test");
}
</script>
</BODY>