Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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...

Posted

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()

Posted

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);  

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...