Printing discrepancies between Crystal Report Designer and C# code

Posted on 2009-02-10
Last Modified: 2012-05-06
I am having some inconsistencies between printing to a text file from Crystal Designer and printing to a text file via the Crystal Reports SDK for .NET. I am using Crystal Reports XI Release 2 SP4 and when I print my report to a file, using a printer and the Generic/Text print driver, the report comes out fine. But when I try to print the same report to a file, using the same printer, via .NET code, the text looks like it is falling off the page. We are wanting to run a bunch of reports in batch and output them to text.

The report was written using a PCL printer and not the Text Printer.

Attached is a snippet of my batch code.

ReportDocument report;


// Loading of the rpt file and setting of authentication credentials


System.Drawing.Printing.PrinterSettings _printerSettings = new PrinterSettings();

System.Drawing.Printing.PageSettings _pageSettings = new PageSettings();

report.PrintOptions.CopyTo(_printerSettings, _pageSettings);


// Set the report to use the print to file printer using the Generic/Text driver

_printerSettings.PrinterName = "TextPrinter";

_printerSettings.PrintToFile = true;

_printerSettings.PrintFileName = this.outputPath;


// Run the report

report.PrintToPrinter(_printerSettings, _pageSettings, false);

Open in new window

Question by:DevMan

    Author Comment

    Another piece of information that might help is that this is a console application, not a web app.
    LVL 100

    Expert Comment

    Try changing the printer to the printer you are going to use to print to.

    Crystal uses the printer driver to render the report.  Changing the driver can cause problems like this.

    Maybe these articles will help

    How Printer Driver Options Affect a Report

    Printer Driver Dependency: How to Design Reports that Print Consistently in Different PC Environments


    Author Comment

    In both Crystal Designer and in my code, I am printing to the exact same printer and driver.  Does Crystal Designer perform some additional formatting before sending the report to the printer?

    Author Comment


    Thank you for the link to the document.  I have gone back and modified my code to reset the page orientation and paper size when I set which printer to use, as recommended in the document.  That still has not fixed the problem.

    For example, the report was designed with a CUSTOMER NUMBER label for a field.  When I print to the Text Printer from Designer, the label comes out as:


    When I print to the exact same Text Printer from my code, the label comes out as:


    Author Comment

    Both the Crystal Designer and .NET code are running on the same machine.
    LVL 100

    Expert Comment

    I don't know.  I don't recall seeing anything in the Crystal KB about an issue like that.

    I'll look to see if there is something.  Most of the issues are font size.


    Accepted Solution

    I have discovered what the problem is.  The report was not designed in a manner which was not printer driver independent.  Modifying the report format appears to be resolving the solution.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now