cancel
Showing results for 
Search instead for 
Did you mean: 

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

sergiu_marincean
Explorer
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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

Answers (5)

Answers (5)

sergiu_marincean
Explorer

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

0 Kudos

Hi Sergiu,

Is the report set to No Printer?

I don't know why, it works fine for me and the Viewers Print button uses the same P2P API....

On the download Wiki there is a link to a Printer test app I wrote, see if that viewers print button works for you.

Don

sergiu_marincean
Explorer
0 Kudos

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

Former Member
0 Kudos

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.

sergiu_marincean
Explorer
0 Kudos

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

0 Kudos

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

sergiu_marincean
Explorer
0 Kudos

Hi Don,

I made tests with SP 21 and I followed all the instructions from https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
I tried with several printers and virtual printers and unfortunately the result is the same.

I will appreciate if someone can confirm that having this problem.
I want to highlight the fact that landscape printing is working normally with .NET Framework version lower than 4.6 installed, but this is not a solution for me.

Thanks for the support,
Sergiu

0 Kudos

What printer are you using?

sergiu_marincean
Explorer
0 Kudos

Hi Don,

I made tests on this printers and virtual printers:
Printers
- Brother MFC-DN8880
- Brother HL-11
- HP Color LaserJet 3600dn
- HP LaserJet P1102

Virtual Printers
- doPDF 8
- Foxit Reader PDF Printer
- PDF Creator
- PDFLite

The issue is reproduced on all above printers.
I appreciate the support,
Sergiu

0 Kudos

So are you saying you don't have any framework other than 4.6 or higher?

Show me a picture of this folder:

C:\Windows\Microsoft.NET\Framework

Don

sergiu_marincean
Explorer
0 Kudos

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