Solved

Print Form Or Data Report in landscape

Posted on 2001-08-09
10
300 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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 25 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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
Course of the Month10 days, 9 hours left to enroll

628 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