2
Answers

Showing error"no printer installed" clicking print in server

Ask a question
deepa ashwi

deepa ashwi

11y
1.3k
1
showing error as"no printer installed" on clicking print button in report at server side but when i run in my local system no problem the pages are getting printed...how to solve it in server side?

following is my code in my code behind:


protected void print_Click(object sender, EventArgs e)
{
try
{
oReport1.Load(Server.MapPath("~/Report/PaySalaryMonthWise.rpt"));


connection.DoCRLogin(oReport1);

CrystalReportViewer1.ReportSource = oReport1;
CrystalReportViewer1.DataBind();


oReport1.PrintToPrinter(1, false, 0, 0);



}






following is my code in my javascript:

function print1()
{

window.print()

Report1.Load(Server.MapPath("~/Report/PaySalaryMonthWise.rpt"));

connection.DoCRLogin(oReport1);

CrystalReportViewer1.ReportSource = oReport1;
oReport1.PrintToPrinter(1, false, 0, 0);



}


<input style="Z-INDEX: 111; LEFT: 703px; WIDTH: 39px; POSITION: absolute; TOP: 8px; HEIGHT: 23px; right: 87px;"
type="button" value="Print" id="Button9" onclick="javascript:window.print()" />



Answers (2)