Solved

Print Form Or Data Report in landscape

Posted on 2001-08-09
10
288 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
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
 
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
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 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

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
SSRS expression Issue finding a string 10 66
using Access 8 58
Search combo error "Data Type Mismatch in Criteria Expression" 2 51
Protecting vb6 & .Net code Obfuscation 18 94
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 …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

911 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