Jelmer Posted August 24, 2006 Posted August 24, 2006 Hello I try to print my crystal report with some print options. This is what i get: CrystalReport1 print = new CrystalReport1(); printDialog1.PrinterSettings.Copies = 2; printDialog1.ShowDialog(); The dialog is displayed... And i like to print the report: print.PrintToPrinter(1, Convert.ToBoolean(1), 0, 1); But that doesn't work... , it just print the document to the normal printer, also if i tell him to print it to another... Normally without the printdialog it works perfect! But i like to set the print conditions... Quote
penfold69 Posted August 24, 2006 Posted August 24, 2006 Extracted from our system, so may not work completely as-is Dim pd As New PrintDialog pd.Document = New Printing.PrintDocument pd.AllowSelection = False If pd.ShowDialog = DialogResult.OK Then Me.Cursor = Cursors.WaitCursor Dim rpt As New rptProductionSchedule Reporting.SetDatabaseForReport(rpt) rpt.SetParameterValue(0, Prodate) rpt.SetParameterValue(1, Hours) rpt.PrintOptions.PrinterName = pd.PrinterSettings.PrinterName rpt.PrintToPrinter(pd.PrinterSettings.Copies, pd.PrinterSettings.Collate, pd.PrinterSettings.FromPage, pd.PrinterSettings.ToPage) rpt.Close() rpt.Dispose() End If pd.Close() pd.Dispose() Quote
Jelmer Posted August 24, 2006 Author Posted August 24, 2006 This works okay:: CrystalReport1 print = new CrystalReport1(); printDialog1.PrinterSettings.Copies = 2; printDialog1.ShowDialog(); //print.PrintOptions = printDialog1.PrinterSettings. print.PrintOptions.PrinterName = printDialog1.PrinterSettings.PrinterName; print.PrintToPrinter(printDialog1.PrinterSettings.Copies, printDialog1.PrinterSettings.Collate, printDialog1.PrinterSettings.FromPage, printDialog1.PrinterSettings.ToPage); // print.PrintToPrinter(1, Convert.ToBoolean(1), 0, 1); NieuwFactuur_Load(sender, e); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.