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
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.
I downloaded the sample and then realized that maybe I wasn't clear enough (although the linked thread explains it).
In your sample change the .igr format from portrait to landscape, then try to print using the built in print button on the reportviewer toolbar. Then you will get the question I referred to.
So the bug is present when your .igr is in landscape. The control should first try to set the printer to landscape instead of throwing the "wrong paper size" warning dialog.
So!
All that you are telling me is what I wrote in my first post. This is just a work-around to get past the bug and not the solution to the problem. My pasted code in the first post also works, and I can also try to print then and click 'No' in the Warning dialog to make it work. None of these work-arounds are good enough.
The thing is, all I should need to do is click the print button in the ViewReport toolbar. The code behind that print button click should do exactly as the code in my first post (which basically is the code Infragistics proved in the linked thread); get the PaperSettings from the report (.igr) and send that to the selected printer using the same .Print method as the code sample is doing, thereby telling the printer to print in either portrait or landscape.
I have several reports in my application and all of these should only need two clicks to print; print-button in toolbar, then print button in Select printer dialog. The user should not need to know if the report is in portrait or landscape mode, and then take measures if it is in landscape to click preferences and try to find the portrait/landscape selection in every custom printer settings window.
Try print from every other standard application; word, acrobat, etc. There is never a need to go tell your printer a landscape document is coming. The application takes care of that.
My application needs to be that good. Your tools are there to help me do this. Taken from your first page: DEVELOP THE ULTIMATE EXPERIENCE
I have opened a private case for you so that I can link it to an internal development investigation. This way you will be notified automatically when the our development team has made any progress. The case number is CAS-146625-P0X4S7. You will see it located here: https://ko.infragistics.com/my-account/support-activity
Let me know if you have any questions regarding this matter by updating the case. Thanks.
Hello,
We are experiencing the exact same problem in an application we created using Infragistics Reporting. I see there is a support case opened for Peter. Can you provide a public status on this case and when a fix will be available?
Thanks,
Kent
I am also being skewered by my users on this bug.
This may not seem like a big deal ("just click No in this dialog box...") to you, but this is actually holding up a prodcution install for me.
Can you provide a public status on this case and when a fix will be available?
Jim
Hello All,
I want to first thank you all for your patience. We are currently working on a new Reporting service release planned to be released within the next couple months which will include a fix for this behavior.
If you have any questions regarding this matter feel free to let me know or by contacting support@infragistics.com.
Sorry, I meant 15.1 installation.
Hi Michael,
Thanks for the update.
How is this fix being released if WPF Reporting is not included in the 15.2 installation?