Page orientation in VB6 Report Object

I just started using VB6 and I am having trouble with the report object. I have figured out most of it, but I can't figure out how to set portriate/landscape settings for the report at design time.

Or is that even posible? Do I have to do it at run time? If so, how? I don't see a property for this.
gwizAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

frankdCommented:
Printer.Orientation = 1 'Sets printer to portrait.

Printer.Orientation = 2 'Sets printer to Landscape.

Hope this helps.
0
gwizAuthor Commented:
That changes it for the report object? I thought that changed it for the default printer.
0
AnswerTheManCommented:
---------------------------------------------------------
Readme.txt file for PageSet.exe
---------------------------------------------------------

This file describes the contents of PageSet.exe, a
self-extracting file.

PageSet.exe is a self-extracting executable file that contains a DLL file that
allows you to programmatically change the printer orientation.

This DLL is particularly useful when dealing with the Data Report, which reads
the default printer orientation prior to displaying or printing a report.
PageSet.exe allows you to programmatically change and reset your printer
orientation.

MORE INFORMATION
================

The following file is available for download from the Microsoft Software
Library:

   PageSet.exe
   (http://support.microsoft.com/download/support/mslfiles/PageSet.exe)

Release Date: Apr-13-1999

For more information about downloading files from the Microsoft Software Library,
please see the following article in the Microsoft Knowledge Base:

   Q119591 How to Obtain Microsoft Support Files from Online Services

\**
\** PARTNER:
\** To help customers obtain these files by means other than the World Wide Web, see
\** the following article in the CROSSPRD rollup (use "S101" in WorkBench to bring
\** up this article only):
\**
\** s101(Q119591)

   
   +---------------------------+
   | FileName           | Size |
   +---------------------------+
   | PageSet.dll        | 1KB  |
   +---------------------------+
   | PageSet.vbp        | 1KB  |
   +---------------------------+
   | frmSit.frm         | 1KB  |
   +---------------------------+
   | Orient.bas         | 8KB  |
   +---------------------------+
   | PrinterControl.cls | 1KB  |
   +---------------------------+
   | Readme.txt         | 1KB  |
   +---------------------------+

On Windows NT systems, PageSet.dll requires administrative access to your printer
settings. To set this up, you will have to save the driver settings to your
local computer, which can be accomplished with the following steps:

1. Using the Add Printer wizard in Control Panel, select My Computer instead of
   Network Printer Server, and then choose Next.

2. Click the "Add Port" button.

3. Select Local Port in the drop-down list box then click New Port.

4. Type the location of the printer on the network. For example:

      \\printserver\printer (this is the exact path of your printer)

5. Select OK and continue with the rest of the setup.

Now you can incorporate the DLL into your application.


1. Use the Regsvr32.exe file to register the Pageset.dll as follows:

      regsvr32.exe <full path to dll>\pageset.dll

2. Reference the Pageset.dll in your application project.

The following code sets your paper orientation to landscape prior to printing or
showing the report.

  Paste the following code in the General Declaration section of your form:

      Dim obj As PageSet.PrinterControl

      Private Sub Command1_Click()
         On Error GoTo errorhandler:
         Set obj = New PrinterControl
         obj.ChngOrientationLandscape
         DataReport1.Show
         DataReport1.PrintReport False, rptRangeFromTo, 1, 1

         Exit Sub

      errorhandler:
          MsgBox Err.Description
          obj.ReSetOrientation
   
      End Sub

      Private Sub Form_Unload(Cancel As Integer)

         obj.ReSetOrientation 'This resets the printer to portrait.

      End Sub

NOTE: In the preceding application you are resetting the printer in the
Form_Unload event. The printer must be reset back to the default orientation. If
not, any print job sent to the network printer will be printed using the
orientation set by your program.

Disclaimer
----------

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IS AT YOUR OWN RISK. Microsoft
provides this code "as is" without warranty of any kind, either express or
implied, including but not limited to the implied warranties of merchantability
and/or fitness for a particular purpose.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

gwizAuthor Commented:
My Gosh!

Can't Microsoft do anything right!

It seems stupid that VB is not able to change the printer ordientation without using some DLL add in like this. Every other program and printer preview control can do it.
0
AnswerTheManCommented:
hey hey hey....calm a little....
until vb6 there was NO built in tool for reports in VB nor in VC++.
in VB6 they came for the FIRST TIME with a very BASIC and poor tool comparing to ACCESS tool. that's just a start. next versions - i'm sure they'll improve it.
until DirectX 7.0 - no VB developer could dreamed to write DirectX.
now - they make it possible.

you see - they are trying to get better and beter all the time LIKE EVRYBODY ELSE, including you and me.
0
gwizAuthor Commented:
True, but they already have the access print engine. You would think it could have been ported over years ago. Oh well. Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.