Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

odd Crystal Reports printing problem

$
0
0

In a Windows Forms application written in C# in Visual Studio 2013 Pro, I created two different Crystal Reports reports for printing different labels on two different 'Zebra UPS 2348+' printers installed and connected via USB to my Windows 7 Pro 64-bit PC with 'CRRuntime_64bit_13_0_14.msi' installed. Each report has a SQL Server table as data source. the respective tables are populated programmatically prior to calling the respective print methods. When I run the application in Visual Studio and when I install and run the application on my PC, the labels print as expected with no errors. However, when I connect and install the printers, install 'CRRuntime_64bit_13_0_14.msi', and install and run the application on any other Windows 7 Pro 64-bit PC, one of the printers (see SlotLabel below) throws a 'Failed to open connection...' exception, while the other printer (see OrderLabel below) prints the label as expected with no errors. The printer names, drivers, and settings are exactly the same on the other PCs as they are on my PC, but the results consistently differ. Does anyone have any idea why? Code snippets follow.

 

 

using CrystalDecisions.CrystalReports.Engine;

using CrystalDecisions.Shared;

 

            try

            {

                SlotLabel slRpt = new SlotLabel();

                slRpt.PrintOptions.PrinterName = "SlotLabels";

                slRpt.PrintToPrinter(1, false, 0, 0);

                slRpt.Close();

                slRpt.Dispose();

            }

            catch (Exception ex)

            {

                MessageBox.Show("PrintSlotLabel error: " + ex.Message);

            }

 

 

            try

            {

                OrderLabel olRpt = new OrderLabel();

                olRpt.PrintOptions.PrinterName = "OrderLabels";

                olRpt.PrintToPrinter(1, false, 0, 0);

                olRpt.Close();

                olRpt.Dispose();

            }

            catch (Exception ex)

            {

                MessageBox.Show("PrintOrderLabel error: " + ex.Message);

            }


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>