Solved

landscape report printed in portrait

Posted on 2002-06-10
11
1,972 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

15 Experts available now in Live!

Get 1:1 Help Now