469,592 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

Landscape printing

Hi, I'm trying to print a text report from an application. It works
fine, except in landscape mode, which it seems to ignore. I have a
function that handles the PrintPage even for the PrintDocument, and I
even tried forcing it to print in landscape mode by adding:
ev.PageSettings.Landscape = True
(where ev is the parameter: ByVal ev As
System.Drawing.Printing.PrintPageEventArgs)
I also tried
printDoc.DefaultPageSettings.Landscape = True
(where printDoc is a PrintDocument that is going to be printed)

But it does not print in portrait/landscape mode. I'm not sure why.
This is kinda serious because several reports are required to be in
landscape mode only.

I'm using VB 2005, and the report's data source is a simple (but wide
;) ) text file.

Jul 18 '06 #1
1 1751
I fixed the problem:

It seems I have to set landscape mode BEFORE I set the PrintPage event
handler, like this:
....
Me.printDoc.DefaultPageSettings.Landscape = True
AddHandler printDoc.PrintPage, AddressOf printPage
....

Well, hope this helps anyone else.

Jul 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by gilga123 | last post: by
reply views Thread by gilga123 | last post: by
3 posts views Thread by MarcJ | last post: by
2 posts views Thread by Andrei Gavra via .NET 247 | last post: by
1 post views Thread by Bill Burke | last post: by
5 posts views Thread by cpopham | last post: by
6 posts views Thread by sheinaz | last post: by
2 posts views Thread by FireStarter | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.