protected void Print_Click(object sender, EventArgs e)
{
try
{
ReportDocument oReport1 = new ReportDocument();
oReport1.Load(Server.MapPath("~/Report/BranchPaySlip.rpt"));
connection.DoCRLogin(oReport1);
CrystalReportViewer1.ReportSource = oReport1;
CrystalReportViewer1.DataBind();
oReport1.PrintToPrinter(1, false, 0, 0);
}
catch (Exception ex)
{
Response.Write(ex.Message.ToString());
}
Iftikar HussainPosted Jul 13, 2013, 7:07 AM
Regards,
Iftikar
deepa ashwiPosted Jul 13, 2013, 7:27 AM
deepa ashwiPosted Jul 13, 2013, 7:12 AM
deepa ashwiPosted Jul 13, 2013, 7:04 AM
deepa ashwiPosted Jul 13, 2013, 6:46 AM
<
input style="Z-INDEX: 111; LEFT: 737px; WIDTH: 53px; POSITION: absolute; TOP: 18px; HEIGHT: 19px; "onclick="javascript:window.print();" type="button" value="Print" id="Button9"/>
Iftikar HussainPosted Jul 13, 2013, 6:42 AM
Regards,
Iftikar
deepa ashwiPosted Jul 13, 2013, 5:42 AM
Iftikar HussainPosted Jul 13, 2013, 4:18 AM
Since you are trying to print from server side, therefor when you have tested locally it used your local printer, but after moving to the server it is trying to find printer in that server. I suggest, you use client side print option using javascript window.print();
Let me know if you need more help
Regards,
Iftikar
Sanjeeb LenkaPosted Jul 13, 2013, 4:17 AM
http://support.microsoft.com/default.aspx?scid=kb;en-us;184291