By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,347 Members | 1,325 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,347 IT Pros & Developers. It's quick & easy.

Crystal Reports Printing Question - VB .NET

P: 12
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!
Feb 2 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.