?
Solved

Printer friendly page in landscape orientation

Posted on 2011-10-14
7
Medium Priority
?
270 Views
Last Modified: 2012-06-27
Hi,

I'm using the following code, trying to set up a printer friendly page that defaults to landscape orientation when printed:

System.Drawing.Printing.PageSettings.Landscape = true

Open in new window

I get the following compile error with that:

"Reference to a non-shared member requires an object reference"
How can I make the landscape orientation work?

(Using VS 2003, VB.Net)

Thanks!  
 



0
Comment
Question by:mbizup
  • 3
  • 2
  • 2
7 Comments
 
LVL 19

Expert Comment

by:Manoj Patil
ID: 36969724
0
 
LVL 19

Expert Comment

by:Manoj Patil
ID: 36969748
Hi this error is not related to your printer setting code

The error sounds like your trying to access the generic class without creating an instance of it.

You need to change or Edit the code


0
 
LVL 61

Author Comment

by:mbizup
ID: 36969781
My question might have been poorly phrased - I'm not trying to turn a fancy web page into a printer friendly page as the link you posted describes.

I have a very simple webpage that looks good printed out.  I just want the print outs to default to landscape orientation so that the users don't have to switch to landscape every time they print it.

<You need to change or Edit the code>

That's the problem I'm trying to solve ...  How do I modify the code to make this work?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 17

Accepted Solution

by:
Carlos Villegas earned 2000 total points
ID: 36969989
Sorry, you can't do that, you can't access the printer settings of a client from a simple aspnet web application, if you want to, you must rely on activex or instead return a printer friendly version of your page in pdf format, by using this last approach you can control how the document must be printed.
0
 
LVL 17

Assisted Solution

by:Carlos Villegas
Carlos Villegas earned 2000 total points
ID: 36969999
Also, this class:
System.Drawing.Printing.PageSettings

Open in new window

Is not valid from the context of a web application, is valid only for printing from a Windows Forms application.
0
 
LVL 61

Author Closing Comment

by:mbizup
ID: 36970043
Got it - that makes sense.

Thank you for the details!
0
 
LVL 17

Expert Comment

by:Carlos Villegas
ID: 36970057
Glad to help
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

840 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