Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 6th, 2007, 03:52 PM
Registered User
Join Date: Sep 2007
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!

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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.