Results 1 to 6 of 6

Thread: Correct Command to Print Datagridview

  1. #1

    Thread Starter
    Hyperactive Member jokerfool's Avatar
    Join Date
    Dec 2006
    Location
    Gold Coast, Australia
    Posts
    452

    Correct Command to Print Datagridview

    When I select a portion of the Datagridview what is the correct command to print the selection?

    I was looking at

    Code:
    DataGridViewPrinter.StartPrint(DataGridView, False, True, "List A", "List B")
    Something def a miss there.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Correct Command to Print Datagridview


  3. #3

    Thread Starter
    Hyperactive Member jokerfool's Avatar
    Join Date
    Dec 2006
    Location
    Gold Coast, Australia
    Posts
    452

    Re: Correct Command to Print Datagridview

    Not compatible with VS2012 looks like I have to download 2008 to see whats going on.

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Correct Command to Print Datagridview

    if you create a new vb2012 project + use Add Existing Item to add the vb2008 Form1 it'll work ok

  5. #5

    Thread Starter
    Hyperactive Member jokerfool's Avatar
    Join Date
    Dec 2006
    Location
    Gold Coast, Australia
    Posts
    452

    Re: Correct Command to Print Datagridview

    Nope this example fails, when I load the form and select certain boxes to print and then print preview it shows me all the pages. Thanks for trying.

    Also this doesnt work either

    Code:
    PrintDocument1.Print()
    Last edited by jokerfool; May 4th, 2013 at 10:41 AM.

  6. #6
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Correct Command to Print Datagridview

    it shows me all the pages
    Er yeah. That's what it does. I think the idea was to show you how to print a complete DGV so that you could adapt it to your needs. There are no magic formulas for this. MS provides no printing support for the DGV. You gotta do it yourself.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width