|
-
Sep 21st, 2007, 04:27 AM
#1
Thread Starter
PowerPoster
-
Sep 21st, 2007, 05:20 AM
#2
Lively Member
Re: How Can I print this in a Grid
I don't understand the problem. It is in a grid already...
-
Sep 21st, 2007, 07:13 AM
#3
Thread Starter
PowerPoster
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.
-
Sep 21st, 2007, 07:35 AM
#4
Re: How Can I print this in a Grid
So, basically, the question is how do I print a Grid control, right?
-
Sep 21st, 2007, 07:48 AM
#5
Thread Starter
PowerPoster
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.
-
Sep 21st, 2007, 08:01 AM
#6
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
-
Sep 21st, 2007, 08:30 AM
#7
Thread Starter
PowerPoster
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.
-
Sep 21st, 2007, 08:36 AM
#8
Re: How Can I print this in a Grid
It has always worked for me.
What kind of grid are you using?
-
Sep 21st, 2007, 08:53 AM
#9
Thread Starter
PowerPoster
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)
-
Sep 21st, 2007, 08:55 AM
#10
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.
-
Sep 21st, 2007, 09:25 AM
#11
Thread Starter
PowerPoster
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.
-
Sep 21st, 2007, 10:14 AM
#12
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|