Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
395
Landscape printing is wrongfully implemented
posted

Greetings!

When Printing in landscape format from the print button in the ViewReport Control (WinForms) the control is missing sending PaperSettings to the printer. Hence we get an ugly dialog telling us "Current printer paper size is different.. bla bla bla". Choose Yes, No, Cancel. Clicking "No" changes the printing layout to landscape. Here's the trick, the control should first set the printing queues orientation to the report default, then check. But it doesn't.

This has been discussed in this thread:
http://www.infragistihttps://ko.infragistics.com/community/forums/f/retired-products-and-controls/69016/override-paper-orientation#349391cs.com/community/forums/p/69016/349391.aspx#349391

Clearly this is a bug in the control since doing it in code yields the correct result (see code below). If we can do it by code, so can the ViewReport control.

LocalPrintServer localPrintServer = new LocalPrintServer();
PrintQueue defaultPrintQueue = localPrintServer.DefaultPrintQueue;
string printerName = defaultPrintQueue.Name;
UltraWinReportViewer.PageSettings currentPageSettings = vrReport.GetCurrentPageSettings();
UltraWinReportViewer.PaperSettings paperSettings = new UltraWinReportViewer.PaperSettings(currentPageSettings.PaperSize, currentPageSettings.PageOrientation);
vrReport.Print(paperSettings, printerName, UltraWinReportViewer.PageRange.All, false);

The solution is NOT to have my own print button and do this. I am using the toolbar control in the ReportViewer and cannot have my on button the form.

I had hopes the PrintStarted event would have information on the selected PrintQueue an perhapas a Cancel event argument so that we could handle it by ourselves, but no.

So, when do you plan to fix this?

/Peter

Parents
No Data
Reply
  • 29105
    Offline posted

    Hello Peter,

    The attached sample that I put together does not reproduce the dialog when printing in landscape. The ReportViewer also contains a print button. It's exposed by clicking the double arrows icon to the far right of the toolbar. There you can print and modify the print settings.

    Please review the sample. The button should print the report that's included in landscape without a dialog prompting. If the behavior doesn't reproduce, please modify it and reattach it to this thread. If it does then I will need your environment details and version of Infragistics you are using. You may want to test on a few machines as well if this happens.

    Let me know if you have any questions regarding this matter.

    ClassLibrary1.zip
Children