Connecting Tech Pros Worldwide Forums | Help | Site Map

Crystal Reports Printing Question - VB .NET

Newbie
 
Join Date: Jan 2008
Posts: 10
#1: Feb 2 '09
Hi All,

I just have a quick question about programmatically setting the paper tray that a Crystal Report prints to using Visual Basic .NET 2005 (The Crystal Reports version is the version that is included with Visual Studio 2005). The code I've used is as follows:

Expand|Select|Wrap|Line Numbers
  1. Dim ProductionCopy As New rptProductionCopy
  2.  
  3. ProductionCopy.SetDataSource(ProductionDataSet)
  4.  
  5. ProductionCopy.PrintOptions.PrinterName = "HP LaserJet 4050 PCL6"
  6. ProductionCopy.PrintOptions.CustomPaperSource = "Tray 1"
  7.  
  8. ProductionCopy.PrintToPrinter(1, True, 0, 0)
I looked up how to do this online about a month ago, and the websites I looked at said that this was the way to set the paper tray that a printer prints to. However, whenever this program code executes, the program sends the print job through Tray 2 for some reason. Is this the correct cody to use to set a different Printer Tray, or are there other, better ways to get this done?

Thanks in advance!

Reply