Report Viewer Landscape Paper Orientation Bug

I was having a problem printing reports using the ActiveX print mode in the Crystal Reports Viewer control. The problem is described exactly here.

When using the Crystal Reports Viewer for .NET, if the PrintMode property is set to ActiveX reports designed to print landscape will display correctly but print portrait.

There is a bug in the crystalprinthost.html located @
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\CrystalReportWebFormViewer3\html\crystalprinthost.html

The following code must be changed in the file:

if (window.dialogArguments.pageorientation) {
    objectTag +="<PARAM NAME=\"PageOrientation\" VALUE=\"";
    objectTag += window.dialogArguments.pageorientation;
    objectTag += "\">";
} 

change it to:

if (window.dialogArguments.[b]paperorientation[/b]) {
    objectTag +="<PARAM NAME=\"PageOrientation\" VALUE=\"";
    objectTag += window.dialogArguments.paperorientation;
    objectTag += "\">";
}

NOTE: You are only changing the javascript property name pageorientation to paperorientation, the param needs to stay the same.

Follow me on Mastodon!