lippo
asked on
landscape report printed in portrait
My Printer Setup in the report is saved with Landscape. However, when the report is called from the URL, the setting changes to Portrait. I knew from the CR website that that CR recognizes the printer (in the report) by name. But my report is on the web, different users have different printer names. It is impossible to match the printer name in the report with the users' printer names. How can I make the Viewer default to landscape as saved in the report?
ASKER
This is a known bug. Many people have problems with the landscape setting when the report is called from the web. It is because of the difference of printer drivers of the web server and the user. I did what CR KBase said to save the printer info to the report, but it still doesn't work.
I tried to see what propety the CRViewer has by adding the component to a VB project. But I couldn't find a propety to set the orientation, which one is it? The one I used is CRViewer.dll (CR Viewer control) and my CR is version is 8.0
I tried to see what propety the CRViewer has by adding the component to a VB project. But I couldn't find a propety to set the orientation, which one is it? The one I used is CRViewer.dll (CR Viewer control) and my CR is version is 8.0
I believe it is called pageorientation but I may be wrong. I'll check at work in the morning.
mlmcc
mlmcc
It's actually set through the Report Object, and is called PaperOrientation.
PaperOrientation - CRPaperOrientation. Gets or sets the current printer paper orientation. For the default printer, crDefaultPaperOrientation is returned. Read/Write Can be written only when formatting idle.
crDefaultPaperOrientation 0
crLandscape 2
crPortrait 1
Some other Print option properties on the Report Object:
PaperSize, PaperSource, PrinterDuplex, PrinterName (Read Only)
PaperOrientation - CRPaperOrientation. Gets or sets the current printer paper orientation. For the default printer, crDefaultPaperOrientation is returned. Read/Write Can be written only when formatting idle.
crDefaultPaperOrientation 0
crLandscape 2
crPortrait 1
Some other Print option properties on the Report Object:
PaperSize, PaperSource, PrinterDuplex, PrinterName (Read Only)
ASKER
Below is the page generated by CR when calling the abc.rpt from the URL (then I used "view code"). I can make it a CFM but I tried to add the PaperOrientation line, and it won't work. Which one is the report object?
<html>
<head>
<TITLE>Crystal Report Viewer</TITLE>
</head>
<SCRIPT LANGUAGE="JavaScript">
</SCRIPT>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript>
<OBJECT ID="CRViewer"
CLASSID="CLSID:C4847596-97 2C-11D0-95 67-00A0C92 73C2A"
WIDTH=100% HEIGHT=95%
CODEBASE="/viewer/activeXV iewer/acti vexviewer. cab#Versio n=8,0,0,37 1">
<PARAM NAME="EnableDrillDown" VALUE=0>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=0>
<PARAM NAME="EnableAnimationContr ol" VALUE=0>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableRefreshButton" VALUE=0>
<PARAM NAME="EnableSearchControl" VALUE=0>
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="EnableSearchExpertBu tton" VALUE=0>
<PARAM NAME="EnableSelectExpertBu tton" VALUE=0>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub window_onLoad()
Page_Initialize()
End Sub
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBro ker.WebRep ortBroker" )
if err.number <> 0 then
window.alert "The Seagate Software ActiveX Viewer is unable to create it's resource objects. To rectify this problem, please install Internet Explorer 4.0 or install DCOM for Windows 95 and the latest Microsoft Scripting Engine. These files are available at Microsoft's web site."
CRViewer.ReportName = "abc.rpt"
else
Dim webSource0
Set webSource0 = CreateObject("WebReportSou rce.WebRep ortSource" )
webSource0.ReportSource = webBroker
webSource0.URL = "abc.rpt"
webSource0.PromptOnRefresh = True
webSource0.PaperOrientatio n = 2 <--???
CRViewer.ReportSource = webSource0
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</body>
</html>
<html>
<head>
<TITLE>Crystal Report Viewer</TITLE>
</head>
<SCRIPT LANGUAGE="JavaScript">
</SCRIPT>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript>
<OBJECT ID="CRViewer"
CLASSID="CLSID:C4847596-97
WIDTH=100% HEIGHT=95%
CODEBASE="/viewer/activeXV
<PARAM NAME="EnableDrillDown" VALUE=0>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=0>
<PARAM NAME="EnableAnimationContr
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableRefreshButton"
<PARAM NAME="EnableSearchControl"
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="EnableSearchExpertBu
<PARAM NAME="EnableSelectExpertBu
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub window_onLoad()
Page_Initialize()
End Sub
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBro
if err.number <> 0 then
window.alert "The Seagate Software ActiveX Viewer is unable to create it's resource objects. To rectify this problem, please install Internet Explorer 4.0 or install DCOM for Windows 95 and the latest Microsoft Scripting Engine. These files are available at Microsoft's web site."
CRViewer.ReportName = "abc.rpt"
else
Dim webSource0
Set webSource0 = CreateObject("WebReportSou
webSource0.ReportSource = webBroker
webSource0.URL = "abc.rpt"
webSource0.PromptOnRefresh
webSource0.PaperOrientatio
CRViewer.ReportSource = webSource0
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</body>
</html>
ASKER
and CRViewer does not have the Paper*/Printer* propeties dbirdman mentioned.
Add a line like
<PARAM NAME="CRPaperOrientation" VALUE=2>
good luck
mlmcc
<PARAM NAME="CRPaperOrientation" VALUE=2>
good luck
mlmcc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
any other solution?
This question has been classified abandoned. I will make a recommendation to the moderators on its resolution in a week or two. I appreciate any comments that would help me to make a recommendation.
Unless it is clear to me that the question has been answered I will recommend delete. It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
If the user does not know how to close the question, the options are here:
https://www.experts-exchange.com/help/closing.jsp
mnye
EE Cleanup Volunteer
Unless it is clear to me that the question has been answered I will recommend delete. It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
If the user does not know how to close the question, the options are here:
https://www.experts-exchange.com/help/closing.jsp
mnye
EE Cleanup Volunteer
Points birdman
I suspect the problem is with the users browser setup. I know when I print from most products, I get portrait but when I print from IE I get landscape by default.
good luck
mlmcc