Link to home
Start Free TrialLog in
Avatar of lippo
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?
Avatar of Mike McCracken
Mike McCracken

I am not familiar with setting up reports from the web but from within VB the viewer has a paperorientation property which can be set to crLandscape.  This may solve your problem.

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
Avatar of lippo

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 believe it is called pageorientation but I may be wrong.  I'll check at work in the morning.

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)
Avatar of lippo

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-972C-11D0-9567-00A0C9273C2A"
    WIDTH=100% HEIGHT=95%
    CODEBASE="/viewer/activeXViewer/activexviewer.cab#Version=8,0,0,371">
<PARAM NAME="EnableDrillDown" VALUE=0>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=0>
<PARAM NAME="EnableAnimationControl" VALUE=0>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableRefreshButton" VALUE=0>
<PARAM NAME="EnableSearchControl" VALUE=0>
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="EnableSearchExpertButton" VALUE=0>
<PARAM NAME="EnableSelectExpertButton" 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("WebReportBroker.WebReportBroker")
    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("WebReportSource.WebReportSource")
          webSource0.ReportSource = webBroker
          webSource0.URL = "abc.rpt"
          webSource0.PromptOnRefresh = True
          webSource0.PaperOrientation = 2 <--???
          CRViewer.ReportSource = webSource0
    end if
    CRViewer.ViewReport
End Sub

-->
</SCRIPT>
</body>
</html>
Avatar of lippo

ASKER

and CRViewer does not have the Paper*/Printer* propeties dbirdman mentioned.
Add a line like

<PARAM NAME="CRPaperOrientation" VALUE=2>

good luck
mlmcc
ASKER CERTIFIED SOLUTION
Avatar of dbirdman
dbirdman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lippo

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
Points birdman