Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Print Form Or Data Report in landscape

Posted on 2001-08-09
10
Medium Priority
?
303 Views
Last Modified: 2008-02-01
I would like to print a form included labels and texts or a data report in landscape but i don't know how to write the code.This is urgent because i'm now working in a project. Hope those who can give some advise and solution to me.Thank you. Another one is, hope you don't mind about my English because i not good in speaking English.Thank you very much.
0
Comment
Question by:Jassy080901
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 

Author Comment

by:Jassy080901
ID: 6370652
Urgent
0
 

Author Comment

by:Jassy080901
ID: 6370657
Print Form  Or Data Report in landscape
0
 
LVL 3

Expert Comment

by:andysalih
ID: 6370686
try putting this in your code before the print part

Printer.Orientation = vbPRORLandscape

cheers
Andyu
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 3

Expert Comment

by:andysalih
ID: 6370695
so your would type

example

Printer.Orientation = vbPRORLandscape
printer.print "i should be landscape"
printer.enddoc

that should print landscape.

cheers
Andy
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 100 total points
ID: 6370703
This article in MSDN:
FIX: Error Message "Report Width is Larger Than the Paper Width" When Showing Data Report in Landscape (Q261193)

Appears to have your solution and I quote:

Microsoft Visual Studio 6.0 Service Pack 4 introduces a new property called Orientation for Data Report. The value for this property is:

rptOrientDefault = 0
rptOrientPortrait = 1
rptOrientLandscape = 2
With this property, you are able to tell the Data Report not to use the orientation setting of the default printer in the Printers Folders. Following is the syntax for implementing the Orientation property:

DataReport1.Orientation = rptOrientLandscape
DataReport1.Show
0
 
LVL 3

Expert Comment

by:andysalih
ID: 6370712
nealy forgot, if you need to change the orientaion when you have finished then use.

Printer.Orientation = vbPRORPortrait

that will return it back to portrait.


hope this helps
Andy
0
 
LVL 3

Expert Comment

by:andysalih
ID: 6370910




Changes between landscape and portrait mode for a printer

make a command button on a form




Sub Command1_Click ()
    Const PORTRAIT = 1
    Const LANDSCAPE = 2
    Const GETSETPAPERORIENT = 30
    Dim Orient As OrientStructure
    Printer.Print "" 
    Orient.Orientation = LANDSCAPE
    x% = Escape(Printer.hDC, GETSETPAPERORIENT, Len(Orient), "", Null)
    Print x%
End Sub

cheers
Andy
0
 
LVL 12

Expert Comment

by:roverm
ID: 6451478
Jassy,

Does your problem still exists ?

If you don't have/don't want to use SP4/5 then you can download PAGESET.EXE. This ZIP contains a DLL (Pageset.dll) which solves your problem.
The zip is complete which example.

http://support.microsoft.com/support/kb/articles/Q198/9/01.ASP

This page also contains a link to a description of your problem.

D'Mzzl!
RoverM
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7199881
Hi Jassy@devx,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: andysalih and acperkins@devx

Jassy@devx, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7213452
Per recommendation, force-accepted.

Netminder
CS Moderator

andysalih: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20335196
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 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