Results 1 to 11 of 11

Thread: ListView Printer

  1. #1

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    ListView Printer


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

    Re: ListView Printer

    I made some adjustments to the class in an attempt to solve some alignment problems. The amended class can be found here.
    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!

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

    Re: ListView Printer

    A few more tweaks and twiddles here.
    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!

  4. #4

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: ListView Printer

    Quote Originally Posted by dunfiddlin View Post
    I made some adjustments to the class in an attempt to solve some alignment problems. The amended class can be found here.
    Quote Originally Posted by dunfiddlin View Post
    A few more tweaks and twiddles here.
    @dunfiddlin. no adjustments necessary. just use reasonable column widths + no problem, everything prints ok

  5. #5
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: ListView Printer

    Quote Originally Posted by .paul. View Post
    Thanks for this paul, , I've never done any printing in .Net and honestly didn't know where to start.

    Added the class to a couple projects for testing and seems to works well except when I have LV set to autosize columns it isn't printing everything, seems to cut off last 2-3 chars in a column.
    Oh and how about an option to add a title centered at the top of the page?

  6. #6

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: ListView Printer

    dunfiddlins tweaks address the issues you mention.
    unfortunately, no icon printing at the moment

  7. #7
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: ListView Printer

    Quote Originally Posted by .paul. View Post
    dunfiddlins tweaks address the issues you mention.
    unfortunately, no icon printing at the moment
    Don't want to print icons anyway. dunfiddlins tweak adds too much spacing.
    Guess I'll just have to tweak around with it myself.
    Thanks!

  8. #8

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: ListView Printer

    this is the simplest fix for the columnwidths when autosized.

    in form_load:

    Code:
    ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent)
    For x As Integer = 0 To ListView1.Columns.Count - 1
        ListView1.Columns(x).Width += 12 'try different widths here
    Next

  9. #9

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: ListView Printer

    @EdgeMeal...

    i updated the zipFiles (included title):

    http://code.msdn.microsoft.com/ListV...inter-7a9be0a7

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

    Re: ListView Printer

    Seems I inadvertently created a bug in my last tweaks. It's solved here.
    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!

  11. #11

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: ListView Printer

    Quote Originally Posted by dunfiddlin View Post
    Seems I inadvertently created a bug in my last tweaks. It's solved here.
    of course i should complain really... that's intellectual property hijacking

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