Print a local RDLC report directly using RSClientPrint

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.