473,378 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Paper orientation - priting - PrintPreviewControl

Hi all!

Desperately need a solution for this. I have a multiple
page orientation print job; My first page is landscape and
next 4 pages are portrait. I am using PrintDocument and
PrintPreviewControl provided by .net

I change the orientation in querypagesettings:

Private Sub PrintDocument1_QueryPageSettings(ByVal sender
As Object, ByVal e As
System.Drawing.Printing.QueryPageSettingsEventArgs )
Handles PrintDocument1.QueryPageSettings
If id = 1 Then
e.PageSettings.Landscape = False
Else
e.PageSettings.Landscape = True
End If
End Sub

and also tried in PrintPage event by doing:
PrintPreviewControl1.Document.DefaultPageSettings. Landscape
= True

the print document/preview sticks to the first orientation.

Am i doing something wrong here???
Nov 20 '05 #1
2 7164
Page Settings in your case should be changed PrintPage Event

http://msdn.microsoft.com/library/de...tpagetopic.asp

"Sachin D." <in**@baroc.co.in> wrote in message
news:01****************************@phx.gbl...
Hi all!

Desperately need a solution for this. I have a multiple
page orientation print job; My first page is landscape and
next 4 pages are portrait. I am using PrintDocument and
PrintPreviewControl provided by .net

I change the orientation in querypagesettings:

Private Sub PrintDocument1_QueryPageSettings(ByVal sender
As Object, ByVal e As
System.Drawing.Printing.QueryPageSettingsEventArgs )
Handles PrintDocument1.QueryPageSettings
If id = 1 Then
e.PageSettings.Landscape = False
Else
e.PageSettings.Landscape = True
End If
End Sub

and also tried in PrintPage event by doing:
PrintPreviewControl1.Document.DefaultPageSettings. Landscape
= True

the print document/preview sticks to the first orientation.

Am i doing something wrong here???

Nov 20 '05 #2
thanks a ton...it helped..and my issue is solved.

regards

Sachin
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: s-galit | last post by:
hi, i created form1 with a printPreviewControl and from form2 im creating an reference to the form1 , but the printPreviewControl is empty thats the code from form2- Dim printPrevCtrl1 As...
5
by: bcanavan | last post by:
When I export xml(and xls) from Access 2003 the result is a complete report in a single page. I would like to get the entire report in a single page (one trip to the server) for printing and...
0
by: Marc Scheuner [MVP ADSI] | last post by:
Folks, How can I get the default printer (not just its name - the "whole" thing), and change its paper orientation to landscape? I'm trying to print a hosted HTML document (inside a web...
0
by: Yaron | last post by:
Hi, I have a PrintPreviewControl placed inside an inherited control (I am designing a wizard, and each wizard 'panel' is technically a control... The PrintPreviewControl is inside one of these...
3
by: D Witherspoon | last post by:
No matter what I do the default paper size is always either A3 or 11 by 8.5 .. Here is the code. Dim dlg As DialogResult pd.DocumentName = "Weld Image" Dim pkPaperSize As New...
0
by: Big George | last post by:
Hello Gurus, I'm developing with VS2003, ASP.NET with Crystal Report for VS.NET, and I need to change the paper orientation of a Crystal Report to Horizontal... How to do that? I tried to...
1
by: Rich | last post by:
Hello, I found some code for printing a report (.rdlc) file without using the ReportViewer control. This code prints in the Portrait orientation which I presume is the default orientation. I...
1
by: anilkumarkp | last post by:
Hai I have to print a receipt in pre-printer stationary with bar code, My paper size is 4", i have set the paers size as Printer.ScaleMode = 1 ' vbTwips Printer.Height = 4 * 1440...
3
by: deciacco | last post by:
I'm trying to write a label printing SDI app with a small preview on the main form itself. Every time I run the InvalidatePreview event on the preview control to redraw the preview I get the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.