I'm using .rdlc report in my web application, exporting report to pdf & print it works great but now i wanted to print report automatically(i,e on click of print button.)
There is no way to print the rdlc report in all three browser Mozilla,Chromeand IE
Please help me if any body know the way.
I am using the below code:
function first_Click() {
//open new window set the height and width =0,set windows position at bottom
var a = window.open('', '', 'left =' + screen.width + ',top=' + screen.height + ',width=0,height=0,toolbar=0,scrollbars=1,status=0');
a.document.write($("#ctl00_ContentPlaceHolder1_rptViewer_ctl09").html());
a.document.close();
a.focus();
//call print
a.print();
a.close();
return false;
}
It is working in all 3 browser but it have the styles problem like table style,color etc.
To avoid style and layout issues when printing a RDLC report you cannot just print the HTML generated by the reporting engine. Each browser will accomodate elements and apply styles differently. The only way to get a common and unique output printing from
a RDLC report is to export it to PDF and print it. Of course, with the built-in functionalty on RDLC, this involves the user to be presented with the PDF document and then print it i.e. many steps/clicks are required by the end user. But
this article shows you a way to print a RDLC report wihtout extra steps and that works in all browsers (IE, Chrome, Firefox, Opera & Safari). You can use that code or get an idea of how to do it by yourself.
Barcode, Labeling, Printing & Imaging tools for ASP.NET Developers
Member
56 Points
87 Posts
Is it possible to print rdlc report automatically?
Oct 10, 2012 06:41 AM|raja01|LINK
I'm using .rdlc report in my web application, exporting report to pdf & print it works great but now i wanted to print report automatically(i,e on click of print button.)
Please help me
Contributor
3829 Points
1281 Posts
Re: Is it possible to print rdlc report automatically?
Oct 15, 2012 02:18 AM|matifnadeem|LINK
Hi raja01,
Please review these links
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/0c3ef3c6-ff5a-4842-b73b-e7ac3d7d26a6
http://www.gotreportviewer.com/
Contributor
2597 Points
880 Posts
Re: Is it possible to print rdlc report automatically?
Oct 15, 2012 02:55 AM|Srikanth Kasturi|LINK
Dear User,
Complete step by step explanation and code snippet :
http://blogs.msdn.com/b/bryanke/archive/2004/02/11/71491.aspx
Srikanth Kasturi
Please "Mark As Answer" if my post serves purpose.
Microsoft Certified Technology Specialist
Member
80 Points
855 Posts
Re: Is it possible to print rdlc report automatically?
Apr 03, 2013 11:22 AM|vikas227|LINK
There is no way to print the rdlc report in all three browser Mozilla,Chromeand IE
Please help me if any body know the way.
I am using the below code:
It is working in all 3 browser but it have the styles problem like table style,color etc.
Thanks
Participant
1170 Points
367 Posts
Re: Is it possible to print rdlc report automatically?
Apr 04, 2013 08:45 AM|Neodynamic|LINK
To avoid style and layout issues when printing a RDLC report you cannot just print the HTML generated by the reporting engine. Each browser will accomodate elements and apply styles differently. The only way to get a common and unique output printing from a RDLC report is to export it to PDF and print it. Of course, with the built-in functionalty on RDLC, this involves the user to be presented with the PDF document and then print it i.e. many steps/clicks are required by the end user. But this article shows you a way to print a RDLC report wihtout extra steps and that works in all browsers (IE, Chrome, Firefox, Opera & Safari). You can use that code or get an idea of how to do it by yourself.