Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1983
  • Last Modified:

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?
0
lippo
Asked:
lippo
  • 4
  • 4
  • 2
  • +1
1 Solution
 
mlmccCommented:
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
0
 
lippoAuthor Commented:
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
0
 
mlmccCommented:
I believe it is called pageorientation but I may be wrong.  I'll check at work in the morning.

mlmcc
0
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 
dbirdmanCommented:
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)
0
 
lippoAuthor Commented:
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>
0
 
lippoAuthor Commented:
and CRViewer does not have the Paper*/Printer* propeties dbirdman mentioned.
0
 
mlmccCommented:
Add a line like

<PARAM NAME="CRPaperOrientation" VALUE=2>

good luck
mlmcc
0
 
dbirdmanCommented:
The PaperOrientation property is not part of CRVIEWER; it's set in the Report Object.  It might work like this:

'Create the Application Object
if Not IsObject(session("oApp")) Then
     Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")
end If

'Open Report
Set session("oRpt") = session("oApp").OpenReport("c:\MyReport.rpt", 1)

session("oRpt").PaperOrientation = 2

Hope this helps.

0
 
lippoAuthor Commented:
any other solution?
0
 
mnyeCommented:
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:
http://www.experts-exchange.com/help/closing.jsp 

mnye
EE Cleanup Volunteer
0
 
mlmccCommented:
Points birdman
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now