Solved

Set Page Orientation using Crystal Reports in VB6

Posted on 2001-08-06
7
2,295 Views
Last Modified: 2012-06-27
Hi all,
I'm using VB6, with Crystal Reports version 4.6.
Is there a way to set the page orientation from the VB code?

The vb program is accessing SQL7.0 tables, then using the call

  crystal.action = 1

to open up the print preview screen.  The page orientation always comes up with whatever the orientation is for the user's default printer.
I've allowed the printer setup box to be available so the user can manually change the orientation, but I would like to have it automatically change to landscape, since the report is made in landscape style.

Any suggestions?
thanks
CraigEng
0
Comment
Question by:CraigEng
  • 3
  • 2
  • 2
7 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6357726
Have you tried setting the Printer Orientation property?
0
 

Author Comment

by:CraigEng
ID: 6357761
To acperkins,

I'm not sure where you mean to set this property.  I've been looking in the custom properties of the crystal reports control, but it doesn't have any orientation...
Do you mean to set it using something other than the crystal control?   I'm not sure how to do this (if that is what you meant...)

Thanks,
CraigEng
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6357904
My idea was for you to set the Orientation for the Printer object to see if that would change the default printer.  But it has been a while since I used Crystal reports and I have no idea if this works.
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.

 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6358023
See list of additional info at bottom.  You have to set both the CRW orientation and the printer orientation if you are printing directly to the printer.  This code sets the CRW orientation (there are other ways to do it depending on your version and technique)

Dim crpApp As CRPEAuto.Application
Dim crpReport As CRPEAuto.Report
Dim crpPageSetup As CRPEAuto.PageSetup

Set crpApp = CreateObject("Crystal.CRPE.Application")
Set crpReport = crpApp.OpenReport("C:\test\myreport.rpt")
Set crpPageSetup = crpReport.PageSetup

' Use any one of the following three constants to set the appropriate orientation

' crpPageSetup.PageOrientation = crDefauttPaperOrientation
' crpPageSetup.PageOrientation = crPortrait
' crpPageSetup.PageOrientation = crLandscape

These links may be helpful:

http://support.crystaldecisions.com/kbase/c2006136.asp?AJID=B48415DA8A0B6144B7E8C4A352DF0A3A
http://support.crystaldecisions.com/kbase/c2000383.asp?AJID=B48415DA8A0B6144B7E8C4A352DF0A3A
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/wraptest.zip.asp?AJID=B48415DA8A0B6144B7E8C4A352DF0A3A
0
 

Author Comment

by:CraigEng
ID: 6403179
Thanks for the input DRRYAN3, (sorry to take so long to comment)

These solutions seem to be for Crystal Version 5 or higher.  I'm wondering if I'm missing something, since the installation from the VB6 disk only gives Crystal 4.6.  I looked on the Crystal site from the links you provided, but I wasn't able to see any way to upgrade.

I'm guessing the page orientation can't be set in Version 4.6.

Thanks,
CraigEng
0
 
LVL 12

Accepted Solution

by:
DRRYAN3 earned 200 total points
ID: 6406485
CraigEng

The upgrade is not free, but is well worth the money if you are doing any development work with CRW.  

If these properties are not available in your current version of Crystal Reports, you will most likely have to set the page orientation at report design time in the designer.  Not being familiar with CR 4.6, you may also find it necessary to set the properties for the default printer prior to printing.

DRRYAN3
0
 

Author Comment

by:CraigEng
ID: 6407485
Thanks for your input and time.
CraigEng
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

Title # Comments Views Activity
Link a textbox in excel to a cell with more than 255 characters. 5 67
VBA open file from excel cell 4 36
VB6 - Convert HH:MM into Decimal 8 53
VB6 ListBox Question 4 34
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

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

17 Experts available now in Live!

Get 1:1 Help Now