Results 1 to 12 of 12

Thread: How Can I print this in a Grid

  1. #1

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    How Can I print this in a Grid

    Hi All,

    I have the following MSFlexgrid. I cut the picture a bit to make it conform with the 500Kb limit on this forum.

    What would be the easiest way to print this in a grid.

    Please help.
    Attached Images Attached Images  

  2. #2
    Lively Member RickyOswaldIOW's Avatar
    Join Date
    Sep 2007
    Location
    Ryde, Isle of Wight
    Posts
    120

    Re: How Can I print this in a Grid

    I don't understand the problem. It is in a grid already...

  3. #3

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: How Can I print this in a Grid

    That grid is on my form. I need to print that same information on a page.

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

    Re: How Can I print this in a Grid

    So, basically, the question is how do I print a Grid control, right?

  5. #5

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: How Can I print this in a Grid

    Yes Hack, either that or another easy way to printin a grid format. I know how to diplay text in a WebBrowser and print it directly from there but how do I display a grid in a WebBrowser or if not a webbrowser some kind of report.

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

    Re: How Can I print this in a Grid

    You didn't say what kind of grid you are using, but this works for both the MSFlexGrid and the MSHFlexGrid. Try it
    Code:
    Private Sub PrintGrid(MyGrid As MSFlexGrid)
    
    Dim OldWidth As Integer
    
    OldWidth = MyGrid.Width
    MyGrid.Width = Printer.Width
    Printer.PaintPicture MyGrid.Picture, 0, 0
    Printer.EndDoc
    MyGrid.Width = OldWidth
    
    End Sub

  7. #7

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: How Can I print this in a Grid

    Hi Hack,

    It isn't working.

    I stepped through the code. Everything seems fine but nothing happens. Is there maybe something missing.

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

    Re: How Can I print this in a Grid

    It has always worked for me.

    What kind of grid are you using?

  9. #9

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: How Can I print this in a Grid

    Hi,

    I am using an MSFlexgrid. Is this right. I just pass the name of the flexgrid as a parameter.

    Call PrintGrid(Me.MSFlexGrid1)

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

    Re: How Can I print this in a Grid

    Well, you don't need the Me if it is on the same form that the sub is on, and it if isn't, you should use the form name.

  11. #11

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: How Can I print this in a Grid

    Hack, it's working. . I had to change my default printer. That's what was wrong. Thanks alot Hack. You are the man.I just have 2 get the width right. It isn't fitting in the page.

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

    Re: How Can I print this in a Grid

    Good, glad to see you got it working for two reasons.

    One, your problem is resolved (don't forget to resolve the thread please) and two, I've used that for years, and posted it many times, and never with a problem so you had me confused and concerned when you said it wasn't working.

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