I think you can understand with following code.
Keep Programming.
SalesInvoice rpt = new SalesInvoice();
rpt.RecordSelectionFormula = SQL;
rpt.SetDatabaseLogon("sa", "pwd");
PrintDialog prtdlg = new PrintDialog();
prtdlg.ShowDialog();rpt.PrintOptions.PrinterName = prtdlg.PrinterSettings.PrinterName;
rpt.PrintToPrinter(prtdlg.PrinterSettings.Copies, prtdlg.PrinterSettings.Collate, prtdlg.PrinterSettings.FromPage, prtdlg.PrinterSettings.ToPage);
Keep Programming.
Comments
Post a Comment