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.
Below 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);
Thanks.