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.:wave:
Printable View
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.:wave:
I don't understand the problem. It is in a grid already...
That grid is on my form. I need to print that same information on a page. :thumb:
So, basically, the question is how do I print a Grid control, right?
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.:afrog:
You didn't say what kind of grid you are using, but this works for both the MSFlexGrid and the MSHFlexGrid. Try itCode: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
Hi Hack,
It isn't working.:cry:
I stepped through the code. Everything seems fine but nothing happens. Is there maybe something missing.:confused:
It has always worked for me.
What kind of grid are you using?
Hi,
I am using an MSFlexgrid. Is this right. I just pass the name of the flexgrid as a parameter.
Call PrintGrid(Me.MSFlexGrid1)
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.
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.:thumb:
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. :)