Unni R

Unni R

  • NA
  • 16
  • 11.2k

No printers are installed in server system

Jun 16 2015 4:36 AM
While publishing below code in server system. in local machine while taking print its showing error message"System.Drawing.Printing.InvalidPrinterException: No printers are installed in server system".


public void print()
{
SC.Open();
SqlCommand cmd = new SqlCommand("select * from converstion where status='A'", SC);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataTable datatable = new DataTable();
da.Fill(datatable);
ReportDocument crreport = new ReportDocument();
crreport.Load(Server.MapPath("~/Conversion.rpt")); crreport.SetDataSource(datatable);
crreport.PrintToPrinter(1, false, 0, 0);
SC.Close();
}

Answers (2)