Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

different result when print using crystal report viewer and PrintOutputController.PrintReport

Hi.

I'm using VS 2015

and CR v13,SP16

i am using user defined paper 12 x 14 cm,

when print using PrintOutputController.PrintReport the result become smaller than it should be.

when print using CRViewer the result is good and as it should be. but user must set the preferences to user defined paper size and the other printer setting. even though my default setting from control panel has been set.

is there anyways to make it programatically sett all of the properties?


datasource for R is setted with another function.

this is my printing code

                PrintDocument pDoc = new PrintDocument();

                PrinterSettings dPrinterSett = new PrinterSettings();

                PageSettings dPageSetting = new PageSettings();

               

                PrintOptions printOption = R.ReportClientDocument.PrintOutputController.GetPrintOptions();

                printOption.DissociatePageSizeAndPrinterPaperSize = false;

                printOption.PaperSize = CrPaperSizeEnum.crPaperSizeUser;

                printOption.PrinterDuplex = CrPrinterDuplexEnum.crPrinterDuplexSimplex;

                PrintReportOptions printReportOption = new PrintReportOptions();

                printReportOption.PaperSize = CrPaperSizeEnum.crPaperSizeUser;

                printReportOption.Collated = true;

               

                R.ReportClientDocument.PrintOutputController.ModifyPrintOptions(printOption);

                R.ReportClientDocument.PrintOutputController.ModifyPrinterName(dPrinterSett.PrinterName);

                R.ReportClientDocument.PrintOutputController.ModifyUserPaperSize((dPageSetting.PaperSize.Height * 1440/100),                                                                                                                         (dPageSetting.PaperSize.Width * 1440/100));

                if (pDoc.DefaultPageSettings.PaperSize.Height > pDoc.DefaultPageSettings.PaperSize.Width)

                {

                    R.ReportClientDocument.PrintOutputController.ModifyPaperOrientation(CrPaperOrientationEnum.crPaperOrientationPortrait);

                }

                else

                {

                    R.ReportClientDocument.PrintOutputController.ModifyPaperOrientation(CrPaperOrientationEnum.crPaperOrientationLandscape);

                }

               

                R.ReportClientDocument.PrintOutputController.PrintReport(printReportOption);

Any Help is appreciated,

Thankyou..

Former Member
replied

Paper size must be defined on the printer before sending to the printer. CR looks for the custom paper size ENUM, if not found it looks for the Custom Paper Size by name, so make sure all of the printers have that paper size created on each PC and using the same Name.

Search for KBA 2163438 and it has a test app to print, see if that works for you.

Don

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question