Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent ::: How to Print MsFlexGrid data ????

Status
Not open for further replies.

snr

Programmer
Oct 8, 2001
78
0
0
US
I am populating msflexgrid by a database query ...
I tried printing it by following code

Printer.Orientation = vbPRORLandscape
Picture1.Picture = grid_datasheet.Picture
sScale = Printer.ScaleHeight * (grid_datasheet.Rows / 50)
Printer.CurrentX = 100
Printer.Font = "Arial"
Printer.FontSize = "10"
Printer.FontBold = False

Printer.PaintPicture Picture1.Picture, 0, 500, Printer.ScaleWidth, sScale

Printer.PaintPicture
Printer.EndDoc
Screen.MousePointer = vbDefault

But it is printing just 1 page ... Like print screen ....
What is the other option ???????

Please help.
Thanks
 
You could always use a for loop to read the contents of the grid and then send them to a printer:

dim intRows as integer
for intRows = 0 to grid.rows - 1
printer.print grid.textmatrix(intRows, col)
next

note that intRows will very depending on the number of rows. I'm assuming that the number of columns for you grid is fixed so you would just concatenate your print string to accomodate the number of columns up to you fixed column number. If your column numbers are not fixed, you could probably do a for loop for the columns within your for loop for rows of the grid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top