Solved

Print Form Or Data Report in landscape

Posted on 2001-08-09
10
296 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

820 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