Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 6th, 2007, 03:52 PM
Registered User
Join Date: Sep 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to print wide datagrid?

I have a wide datagrid and I would like to print it in landscapge setting. But it always print portrait instead. this is the code I used:

       Dim pd As New PrintDocument
        AddHandler pd.PrintPage, AddressOf Me.pd_PrintPage
       Dim psd As New PageSetupDialog
        Dim printerSet As New PrinterSettings
        pd.DefaultPageSettings.Landscape = True

        printerSet.DefaultPageSettings.Landscape = True
        With psd
            .AllowMargins = True
            .AllowOrientation = True
            .AllowPaper = True
            .ShowHelp = True
            .ShowNetwork = True

            .Document = pd
        End With


        Dim myPaintArgs = New PaintEventArgs(e.Graphics, New Rectangle (New Point(0, 0), DataGrid1.Size))
        Me.InvokePaint(DataGrid1, myPaintArgs)

can anybody give me some idea? Thank you!

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Print Datagrid in vb.net 2003 rngrmn VB.NET 2002/2003 Basics 0 April 6th, 2006 04:23 PM
to print datagrid contents josna VB.NET 6 January 13th, 2006 12:02 AM
how to print the contents of datagrid using vb.net kumarkaushal VB.NET 2002/2003 Basics 1 March 21st, 2005 01:15 AM
print datagrid or dataset hanzahalka ADO.NET 1 March 20th, 2005 09:40 PM
Print of DataGrid KashifAzam C# 1 September 16th, 2004 02:09 PM

All times are GMT -4. The time now is 11:00 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.