473,383 Members | 1,717 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,383 software developers and data experts.

How to set printer settings in code behind in vb.net2.0?

139 100+
Hai All,

I want to set printer settings in code behind like Landscope="true" and page scalling="Fit to page", bcuz im having more columns in my datagrid.

Thanks,

Aswath.
Apr 22 '08 #1
4 1726
DrBunchman
979 Expert 512MB
Hi Aswath, this snippet will set the default printer to landscape for the document. Note that this will apply to the server and not the client machine.

Expand|Select|Wrap|Line Numbers
  1.  Dim printDoc As New System.Drawing.Printing.PrintDocument printDoc.PrinterSettings.DefaultPageSettings.Landscape = True
Hope this helps,

Dr B
Apr 22 '08 #2
bhappy
139 100+
Hai,

Thanks for replay,

currently im using javascript code <script window.print> Here it will open print dialog box but user donot select landscape option then he won't get last columns..?Any idea for this plz...............

Thanks,
Aswath.
Apr 22 '08 #3
DrBunchman
979 Expert 512MB
I don't believe it's possible (but am not 100%) because the printer settings are part of the client machines config which you can't normally get access to for security reasons.

You may have to settle for some sort of message telling the user to select landscape. And after all, if they print it out in portrait what's the worst that could happen? They'll just have to do it again!

Sorry I couldn't be more helpful,

Dr B
Apr 22 '08 #4
bhappy
139 100+
Hai,

Thanks for ur response,

I got new problem now, that is i increased no.of columns and now my datagrid contain nearly 30 columns, and if i select landscape option also im not getting last columns, Is there any way to get last columns in 2nd page........

Thanks,
Aswath.
Apr 22 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Umesh | last post by:
Hi all I am trying to change the printer(like paper source ,etc) setting in C#. But i am unable to do it. I am not sure how to do it. should i have to use WIN API like Openprinter , getprinter ,...
2
by: qumpus | last post by:
My program right now generates USPS style shipping label using System.Drawing.Graphics. It works fine except that the printer prints really slowly. I want to make my program take advantage of true...
0
by: KohlerTommy | last post by:
In my application I need to give the user the ability to print duplex if the selected printer supports duplex printing. Many of the printer options do not make much sense in my application, and...
1
by: Karthic | last post by:
When i right click on the .rpt file in the VS 2003, i see a property printer setting. It says "No printer" on the top and there is option to select printer and paper settings etc.. I want to...
0
by: Tessa | last post by:
Is there any security reason why you cannot print to a network printer from ASP.NET under IIS6 on Windows 2003 server? I'm using ASP.NET code to print to a server print queue using...
1
by: Anthony Nystrom | last post by:
I need to within code control some printer settings before raising the print dialog... I need to set some properties for the printer such as "The Printer to Print too", Page settings such as paper...
0
by: Anthony Nystrom | last post by:
I am having trouble with changing printer settings before I raise either the pagesetup dialog or the print preview dialog... Changing the printer name is easy, but I am also trying to change the...
11
by: pamelafluente | last post by:
I am doing my own PrintDialog, and have placed there a combo with the printer names, as in the PrintDialog provided by VB.NET. Here is the question: how do I open the native windows printer...
1
by: sathyp | last post by:
Public Function SetPrinterDefaultsW(ByVal sPrinterName As String, _ ByVal nPaperSize As Long, ByVal nOrientation As Long) As Boolean Dim Prn As Printer Dim hPrinter As Long Dim pd As...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.