Solved

Print Form Or Data Report in landscape

Posted on 2001-08-09
10
282 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
Comment Utility
Urgent
0
 

Author Comment

by:Jassy080901
Comment Utility
Print Form  Or Data Report in landscape
0
 
LVL 3

Expert Comment

by:andysalih
Comment Utility
try putting this in your code before the print part

Printer.Orientation = vbPRORLandscape

cheers
Andyu
0
 
LVL 3

Expert Comment

by:andysalih
Comment Utility
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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 3

Expert Comment

by:andysalih
Comment Utility
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
Comment Utility




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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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.
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 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…

772 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

8 Experts available now in Live!

Get 1:1 Help Now