Skip to Content

Landscape printing is not working normally in .NET Framework version 4.6 or higher?

Hi,

I have this issue with landscape printing. When a report has landscape orientation it is printed in portrait mode, and a part of the content is not visible in the printed result.
I made a lot of environmental tests and I discovered this issue occurred when on the machine is installed .NET Framework version 4.6 or higher in combination with any Crystal Reports runtime version.
Example:

1. Wrong print result


2. Expected print result


This issue was in the past and was resolved in Crystal Reports version 13_0_17 for .NET Framework version 4.5.2
The clients use Windows 10 and .NET Framework downgrade is not a solution for me.

I hope that someone can help me with this issue.

Thanks,
Sergiu

result.jpg (23.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    Sep 22, 2017 at 04:43 PM

    Really... you didn't look very hard.

    Printing Crystal Reports in .NET

    No Printer means it is using the Default printer properties, it's likely finding the XPS printer and that driver is not capable of printing landscape.

    Don

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 20, 2017 at 02:10 PM

    Hi Don,

    I made another test today. I created a custom Print button in my solution, calling the PrintToPrinter(), ReportDocument method, and the landscape printing problem was gone. All good.

    I still have this problem when I use the Print button from CrystalReportsViewer:



    If I can find a solution, I prefer to use the CrystalReportsViewer Print button, not a custom one.

    Thanks,
    Sergiu

    Add comment
    10|10000 characters needed characters exceeded

    • Yes, the report is set to No Printer.

      My custom Print button code, calling the P2P method(Landscape printing OK):

      System.Windows.Controls.PrintDialog printDialog =newSystem.Windows.Controls.PrintDialog();
      printDialog.PageRangeSelection = PageRangeSelection.AllPages;
      printDialog.UserPageRangeEnabled = true;
      Nullable<Boolean>print= printDialog.ShowDialog();if(print== true){System.Drawing.Printing.PrinterSettings printerSettings =newSystem.Drawing.Printing.PrinterSettings();
              PageSettings pageSettings =new PageSettings();rep.PrintToPrinter(printerSettings, pageSettings, false);}

      Sorry, but I can't find the link to Printer test app. Can you provide me a download link?

      Thanks,
      Sergiu

  • Aug 14 at 10:02 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Aug 02 at 08:40 AM

    Hi,
    Problem was resolved in Service Pack 23!
    List of Fixed Issues:
    "Incident 87397 WPF viewer will not print landscape on Windows 10 1709 and Windows 7 2607294 2615736"
    Thanks,
    Sergiu

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 18, 2017 at 04:31 PM

    Try using SP 21, requires a bunch of changes so read the info on the download wiki:

    https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

    Does the printer have an updated driver available that's supported in 4.6?

    Don

    Add comment
    10|10000 characters needed characters exceeded

    • As far as I know, .NET Framework 4.6 or higher contain all previous versions.

      The tests were made in those steps, on a Windows 7 machine were I had the possibility to install custom .NET Framework version:
      1. Installed .NET Framework 4.0 - Landscape printing OK
      2. Upgraded to .NET Framework 4.5 and restarted computer - Landscape printing OK
      3. Upgraded to .NET Framework 4.5.1 and restarted computer - Landscape printing OK
      4. Upgraded to .NET Framework 4.5.2 and restarted computer - Landscape printing OK
      5. Upgraded to .NET Framework 4.6 and restarted computer - Landscape printing WRONG
      6. Upgraded to .NET Framework 4.6.1 and restarted computer - Landscape printing WRONG
      7. Upgraded to .NET Framework 4.6.2 and restarted computer - Landscape printing WRONG
      8. Upgraded to .NET Framework 4.7 and restarted computer - Landscape printing WRONG

      Thanks
      Sergiu

      framework.jpg (165.3 kB)
  • Aug 14 at 10:01 PM

    Unfortunately, SP 23 did not resolve the issue for me. When printing from the WPF Viewer in landscape mode on legal paper- The document ends up printing with 8.5in width (as if it was portrait) and cuts off half of the report. It rotates 90 degrees and I end up losing most of my page. Has anyone else experienced this? I've tried with every combination of "No Printer / Printer" and "Disassociate". If I print from the "Visual Studio 2017 Designer" in "Preview" mode, everything works as it should. Any help would be greatly appreciated, I've been waiting months for SP 23 to release and fix this, and here I am still waiting with another broken iteration of an application that I can't give to a customer.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded