Solved

landscape report printed in portrait

Posted on 2002-06-10
11
1,973 Views
Last Modified: 2011-10-03
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
Comment
Question by:lippo
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 7069731
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
 

Author Comment

by:lippo
ID: 7071809
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 7071822
I believe it is called pageorientation but I may be wrong.  I'll check at work in the morning.

mlmcc
0
 
LVL 6

Expert Comment

by:dbirdman
ID: 7073524
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
 

Author Comment

by:lippo
ID: 7074454
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:lippo
ID: 7074460
and CRViewer does not have the Paper*/Printer* propeties dbirdman mentioned.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 7075422
Add a line like

<PARAM NAME="CRPaperOrientation" VALUE=2>

good luck
mlmcc
0
 
LVL 6

Accepted Solution

by:
dbirdman earned 50 total points
ID: 7075751
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
 

Author Comment

by:lippo
ID: 7081880
any other solution?
0
 
LVL 7

Expert Comment

by:mnye
ID: 9346816
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 9350978
Points birdman
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now