Report Viewer Landscape Paper Orientation Bug

Back to Listing

Report Viewer Landscape Paper Orientation Bug


31 Mar, 2008


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.

Share this story

Bobby Johnson

About Author

I am a passionate engineer with an interest in shipping quality software, building strong collaborative teams and continuous improvement of my skills, team and the product.

comments powered by Disqus
Back to top