Search code examples
c#crystal-reports

Crystal Report is always picking pdf printer as default


I have created a report in crystal report and my problem is that my code is not making picking windows default printer don't know y.here is my printers. Application at the point of printing is picking the pdf printer but have set the highlighted printer as default

And here is my code to print the report

MyCrystalReport rep=new MyCrystalReport();
            
            rep.SetParameterValue("cash_tendered", "100");
            rep.SetParameterValue("change", "50");
            rep.SetParameterValue("pay_mode","Cash");
            try
            {


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

            }
            catch (Exception ex)
            {
                AppUtil.showErrorBox("Printer Error!!\n" + ex.Message);
            }

Solution

  • In your report designer go into Page Setup and check the Printer Options section. It should be set to either the printer you want to use for the report, or check the check box for "No Printer".