Ya i want to print it in client side. I found a temprory solution that is. Placed the reportviewer into the div and printed that using jquery...
Java Script
<script language="javascript" type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function printdiv(printpage) {
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body></html>";
var newstr = document.getElementById(printpage).innerHTML;
var oldstr = document.getElementById("body1").innerHTML;
document.getElementById("body1").innerHTML = headstr + newstr + footstr;
window.print();
document.getElementById("body1").innerHTML = oldstr;
return false;
}
<div id="body1">
<input name="b_print" type="button" class="ipt" onclick="printdiv('div_print');" value="Print" />
<div id="div_print">
<h1 style="Color:Red">The Div content which you want to print</h1>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="944px" ShowPrintButton="true" SizeToReportContent="True" AsyncRendering="false" ></rsweb:ReportViewer>
</div>
//Other content you wouldn't like to print
//Other content you wouldn't like to print
</div>
nice trick! Sometimes html printing becomes uncontrollable as each browser has its own "engine" for doing such thing. If you find in such situation, then one another possible solution is to rely on PDF format. You may export the report to PDF through code
and then print it to the client printer. Printing output will be the same independently of the client browser. In
this article it talks about doing such thing with a local report RDLC but you can make minor changes to make it to work with server reports RDL. Anyway, if your current trick is working, then stay with it. Cheers,
SSRSprintprogramatically
Barcode, Labeling, Printing & Imaging tools for ASP.NET Developers
Member
17 Points
36 Posts
SSRS print programatically
Jun 28, 2013 07:02 AM|Golds|LINK
Hi,
How to print ths SSRS Report in programatically in asp.net
SSRS printprogramatically
Participant
1170 Points
367 Posts
Re: SSRS print programatically
Jun 28, 2013 08:49 AM|Neodynamic|LINK
Do you want to print the report to the client printer? Do you want to preview the report or just print it without doing that?
SSRS printprogramatically
Member
17 Points
36 Posts
Re: SSRS print programatically
Jun 29, 2013 01:55 AM|Golds|LINK
Hi Neo
Ya i want to print it in client side. I found a temprory solution that is. Placed the reportviewer into the div and printed that using jquery...
Java Script
SSRS printprogramatically
Participant
1170 Points
367 Posts
Re: SSRS print programatically
Jun 29, 2013 06:55 AM|Neodynamic|LINK
nice trick! Sometimes html printing becomes uncontrollable as each browser has its own "engine" for doing such thing. If you find in such situation, then one another possible solution is to rely on PDF format. You may export the report to PDF through code and then print it to the client printer. Printing output will be the same independently of the client browser. In this article it talks about doing such thing with a local report RDLC but you can make minor changes to make it to work with server reports RDL. Anyway, if your current trick is working, then stay with it. Cheers,
SSRS printprogramatically