hi
I am trying to print a report (.rdlc) from button click as below. It throws a message as same as from a report viewer control.
private void btnPrint_Click(object sender, EventArgs e)
{
Report1.PrintOptions.PrinterName = cmbPrinters.Text;
Report1.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)GetPaperSize(cmbPrinters.Text, "A4");
Report1.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
Report1.PrintToPrinter(1, false, 1, 1);
MessageBox.Show("Print Done");
}
when it comes to the line :
Report1.PrintToPrinter(1, false, 1, 1);
it throws exception saying
"The RPC server is unavailable"
. The printer is working fine. Its a network printer and I have given proper path for it.
The point to be noted is, when for the first time I tried to print it threw exception saying
"The RPC server is unavailable"
there after. Please help.
Thanks
code block corrected