Skip to Content

Crystal Reports XI will not print to tray 2 in VB.NET Runtime

Crystal Report XI is set to print to tray 2. Default printer on my pc has been set. If I run it from crystal, it prints to tray 2. If I run it from VB.net 2013 code, it prints to the default tray. When I debug the Report Document object, it shows the PrintOptions.PaperSource property with a value of 260. I believe this is the Tray 2. When I load the next report, the PrintOptions.PaperSource shows 15, which is the default tray. So it seems to recognize the Crystal Reports' tray selection, however it seems to ignore it when it prints. Here is the code:

cryRpt = NewReportDocument

With cryRpt

If bAPCheck.CheckAmt <= 0 Then

.Load("\\LTR1SOLAP01\Microsoft Dynamics\SL\Applications\AP\03620zc-stuff2.rpt")

Else

.Load("\\LTR1SOLAP01\Microsoft Dynamics\SL\Applications\AP\03620pc-stuff2.rpt")

EndIf

.SetParameterValue("@RefNbr", Trim(bAPCheck.CheckRefNbr))

.PrintToPrinter(1, True, 0, 0)

.Refresh()

.Load("\\LTR1SOLAP01\Microsoft Dynamics\SL\Applications\AP\03620ps-stuff2.rpt")

.SetParameterValue("@RefNbr", Trim(bAPCheck.CheckRefNbr))

.OpenSubreport("Overpayment")

.SetParameterValue("@RefNbr", Trim(bAPCheck.CheckRefNbr))

.OpenSubreport("Refund")

.SetParameterValue("@RefNbr", Trim(bAPCheck.CheckRefNbr))

.PrintToPrinter(1, True, 0, 0)

EndWith

cryRpt.Dispose()

Commented code are some things I've been trying.

'.PrintOptions.PaperSource = 259 ' Default

'.PrintOptions.PrinterName = "\\DUB1FP02\NET01"

'cryRASPrOpt = New CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions

'cryIsRptClDoc = cryRpt.ReportClientDocument

'cryIsRptClDoc.PrintOutputController.PrintReport(cryRASPrOpt)

'.PrintOptions.PaperSource = CrystalDecisions.Shared.PaperSource.Lower

' cryRASPrOpt = New CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions

' With cryRpt

'cryIsRptClDoc = cryRpt.ReportClientDocument

'cryIsRptClDoc.PrintOutputController.PrintReport(cryRASPrOpt)

I have tried setting the PrintOptions.PaperSource to various number and set the PrintOptions.PrinterName, still does not recognize the tray 2.

I appreciate any help, I have run out of things to try.

Thanks,

Add a comment
10|10000 characters needed characters exceeded

Related questions

9 Answers

  • Best Answer
    Posted on Jan 25, 2019 at 05:16 PM

    Hi Todd

    I don't know what SDK you are using but try this, download SP 24 and read the info on updating to SP 21.

    https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

    Then download this printer test app, use a report with saved data:

    Printing Crystal Reports in .NET

    See if it works.

    Don

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 25, 2019 at 07:07 PM

    And what version of the CR SDK are you using?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 26, 2019 at 01:23 AM

    I'm not sure. My original Crystal Report was in 8.5. I installed Crystal Reports XI. I opened 8.5 crystal in XI and called it from VB.NET code. I can print the reports, but can not print to tray 2. I don't think I have a Developers Kit for Crystal. We have a group of developers that use Business Objects. I have installs for Business objects XI R3.1 Client Tools, SP3.Install, SP4, SP6 and SP7. Would Business Objects Install solve this issue? Or what you're saying is there is a Crystal Report Developers Kit I need? I'm missing a printer object from this kit?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 29, 2019 at 03:31 PM

    I just loaded Crystal XIII CRforVS_13_0_21.exe and still cannot print to tray 2?

    Today, I'm using VB6 code calling a Crystal 8.5 document using a Crystal Report User Control. Prints to tray 2 just fine.

    Upgraded the vb6 code to VB.NET. Upgraded the Crystal 8.5 to Crystal XI. In VB.NET, I'm using the CrystalDecisions object running the code above. In crystal design, the crystal report A is set to go to" Tray 2" in the page setup. Crystal Report B is set to go to "Automatically Select" in page set up. When I step through the code the PrintOptions.PaperSource = 260, which from my research is the number associated with Tray 2 on the HP9050 printers. Then when I call Crystal Report B, it changes to 15, which is the number for Automatic. It seems to update the PaperSource in the code but does not execute that command in the code to direct the print to Tray 2.

    Do we know of anyone who has successfully printed to Tray 2? Is this a bug in Crystal?

    Sorry, just a little desperate to get this figured out. It's an important piece of my project.

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 30, 2019 at 03:58 PM

    How do I determine what SDK we are on?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 30, 2019 at 04:25 PM

    Hi Todd,

    This forum is not posting in order so it's confusing what is happening....

    More info for you:

    VB 6 will not work with CR .NET SP 21 or any for that matter.

    You cannot simply instlal SP 21 and expect your VB 6 app to work, you must upgrade VS and CR runtime.

    You must upgrade the CR 8.5 reports as well to current version, CR 9 we rebuilt all of the database drivers for Crystal reports and runtime. Those old CR 8.5 DB drivers will not work, or shoudl not work, and you cannot have CR 8.5 on the same PC as the latest versions, it will cause problems if you do that.

    Get Visual Studio 2010 -> 2017 and then instlal the Yellow button (EXE) into VS on your DEV PC.

    All other links are for distributing the runtime.

    To find out what version you installed go to Programs and Features and look at the SAP CR for VS runtime version.

    And in your VS 2010+ project look at the assemblies, they should be either 13.0.2000.0 or 13.0.3500.0. Those are the Framework versions and not the actual version of the dll's.

    Don

    Add a comment
    10|10000 characters needed characters exceeded

    • Yes, this post is very confusing.

      I'm not sure what you mean when you say Programs and Features. I'm working with Crystal Reports XI and VB.NET.

      Review my issue:

      I'm using VB6 code calling a Crystal 8.5 document using a Crystal Report User Control. Prints to tray 2 just fine.

      I'm trying to upgraded the vb6 code to VB.NET code. Upgraded the Crystal 8.5 to Crystal XI. In VB.NET, In my upgraded VB.NET code, I'm printing my upgraded Crystal XI to the printer, but I cannot get it to go directly to Tray 2. I'm interfacing with a Microsoft Dynamics Solomon Package.

      I think I'm missing the Crystal SDK package?

  • Posted on Jan 31, 2019 at 10:35 PM

    CR XI had the RDC and .NET SDK's. XI is no longer supported, it does not matter ( mostly ) what version of the RPT are)

    In any case the only supported .NET SDK is for VS 2010 -> 2017 and CR for VS from here:

    https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

    So what version VB.NET are you using?

    You can try getting CR XI R2 ( version 11.5 ) from here:

    http://downloads.businessobjects.com/akdlm/crystalreports/crxir2_sp4_full_bld_0-20008684.exe
    http://downloads.businessobjects.com/akdlm/crystalreports/CRYSTALREPORTS06_0-20008684.EXE
    https://www.crystalreports.com/versions

    If that doesn't fix the tray issue then only option is to upgrade, no more patches for XI R2.

    Don

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 01, 2019 at 07:22 PM

    Search for crpe32.dll, that will test us the version.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 04, 2019 at 10:05 PM

    Hi Todd

    I don't know what SDK you are using but try this, download SP 24 and read the info on updating to SP 21.

    https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

    Then download this printer test app, use a report with saved data:

    Printing Crystal Reports in .NET

    See if it works.

    Don

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.