My recommandation: answered by Dhaest
Main Topics
Browse All Topicsi wanna to print a taple from the type FGrid the quistion is how can i print it in the wide of peaper ...."the gool of this to print the all taple elements"...and i wanna to print it alone i mean..that .i wanna to print the just the table...with out the else objects..
omar.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: DhaestPosted on 2004-03-31 at 21:46:01ID: 10729791
Multiple possibilities
ry.Text) > Printer.ScaleHeight - 600 Then
1) - this gives the content in the first row, first column. Likewise, when you put in a For Loop u can get the content in each cell. Further, for each row of data, you can append to a string and pass it to the printer object.
r,1) r,2)
rid As MSFlexGrid, _
it
ter.width
width
1)
Public Sub MSFlexGridPrint(gridQuery As Control)
' *** Print MSFlexGrid
Dim I As Integer
Dim J As Integer
Dim PTab As Integer
For I = 1 To gridQuery.Rows - 1
PTab = 20 'Set the first tab value
'This checks to see if a page break is needed
If Printer.CurrentY + Printer.TextHeight(gridQue
Printer.NewPage
End If
gridQuery.Row = I 'Set the active row
For J = 0 To gridQuery.Cols - 1
gridQuery.Col = J 'Set the current column
'Send the field to the print line and add the tab.
'Notice the semicolon at the end of the line.
Printer.Print Trim$(gridQuery.Text); Tab(PTab);
PTab = PTab + 20 'Increment the tab value
Next
'After each column has printed to the print line
'a Printer.Print statement without a semicolon will
'will send the line to the printer and start a new
'one.
Printer.Print
Next
End Sub
2)
MSFlexigrid1.TextMatrix(1,
(Eg):
For Ctr = 1 to MSFlexigrid1.Rows - 1
strcontent = MSFlexigrid1.TextMatrix(Ct
strcontent = strcontent & MSFlexigrid1.TextMatrix(ct
' where 1 & 2 are the columns. Like wise you can continue to build the string for each row & finally print.
printer.print strcontent
Next
4) Export to an invisible excel and print
try this out!!
Public Sub FlexGrid_To_Excel(TheFlexg
TheRows As Integer, TheCols As Integer, mode As Integer)
Dim objXL As New Excel.Application
Dim wbXL As New Excel.Workbook
Dim wsXL As New Excel.Worksheet
Dim intRow As Integer
Dim intCol As Integer
On Error Resume Next
' open Excel
If mode = 1 Then
objXL.Visible = True
Else
objXL.Visible = False
End If
Set wbXL = objXL.Workbooks.Add
Set wsXL = objXL.ActiveSheet
' this is to fill the worksheet
For intRow = 1 To TheRows
For intCol = 1 To TheCols
With TheFlexgrid
wsXL.Cells(intRow, intCol).Value = _
.TextMatrix(intRow - 1, intCol - 1) & " "
wsXL.Columns(intCol).AutoF
End With
Next
Next
If mode = 2 Then
wsXL.PrintOut
End If
End Sub
5)
Here's a quick way to print a MSFlexGrid control's contents:
Printer.PaintPicture MSFlexGrid_Name.Picture, 0, 0
Printer.EndDoc
And if you want it to be the full length of the printer page add this before those two statements:
Dim old_width as Integer
MSFlexGrid_Name.width=prin
and this at the end:
MSFlexGrid_Name.width=old_