Results 1 to 3 of 3

Thread: How to print a listview's or datagrid's content as a report??

  1. #1

    Thread Starter
    Lively Member Yok's Avatar
    Join Date
    Feb 2001
    Location
    Guangzhou,China
    Posts
    72

    How to print a listview's or datagrid's content as a report??

    ?

  2. #2
    Frenzied Member John McKernan's Avatar
    Join Date
    Jan 2002
    Location
    SE PA
    Posts
    1,295
    This code works for printing MS Flexgrids, never tried it on ListViews or Datagrids though.
    VB Code:
    1. Private Sub PrintGrid(MyGrid As MSFlexGrid)
    2.  
    3. Dim OldWidth As Integer
    4.  
    5. OldWidth = MyGrid.Width
    6. MyGrid.Width = Printer.Width
    7. Printer.PaintPicture MyGrid.Picture, 0, 0
    8. Printer.EndDoc
    9. MyGrid.Width = OldWidth
    10.  
    11. End Sub
    You will have to change the references to MSFlexGrid to the control you are using.

    Hope it helps.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

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