PoppapumpJ
Programmer
I am looping through a flex grid to generate a report.
For every cell in a row I have been using this line
Printer.Print .Text & vbTab;
the row builds fine, but I need to be align the columns. I have tried this:
Printer.Print .Text & Space(7 - Len(.Text))
that seems like it would space everything correctly, but instead it starts writing the next column on the next line. Leaving the vbTab; at the end does continue the line but throws off the allignment.
Any suggestions on how to make a line contine without using vbTab;
here is my entire code
Limits have been set to prevent printing the entire report, thus saving time and paper.
With grdMain ' Flex grid with data
For introw = 0 To 10 'intRecCount ' Loop for each line to print.
.Row = introw ' Set flex grid row.
.Col = 9
If .Text = CLIENT_ROW Then
Printer.FontBold = True
Else
Printer.FontBold = False
End If
Printer.Print Space(3);
'print column 1
.Col = 0
Printer.Print .Text & Space(7 - Len(.Text)) & vbTab;
For intcol = 1 To grdMain.Cols - 1 ' Last col var previously set
.Col = intcol ' Set flex grid Column.
Printer.Print .Text & vbTab;
Next
Printer.Print
Next
End With
Printer.EndDoc
thanks
For every cell in a row I have been using this line
Printer.Print .Text & vbTab;
the row builds fine, but I need to be align the columns. I have tried this:
Printer.Print .Text & Space(7 - Len(.Text))
that seems like it would space everything correctly, but instead it starts writing the next column on the next line. Leaving the vbTab; at the end does continue the line but throws off the allignment.
Any suggestions on how to make a line contine without using vbTab;
here is my entire code
Limits have been set to prevent printing the entire report, thus saving time and paper.
With grdMain ' Flex grid with data
For introw = 0 To 10 'intRecCount ' Loop for each line to print.
.Row = introw ' Set flex grid row.
.Col = 9
If .Text = CLIENT_ROW Then
Printer.FontBold = True
Else
Printer.FontBold = False
End If
Printer.Print Space(3);
'print column 1
.Col = 0
Printer.Print .Text & Space(7 - Len(.Text)) & vbTab;
For intcol = 1 To grdMain.Cols - 1 ' Last col var previously set
.Col = intcol ' Set flex grid Column.
Printer.Print .Text & vbTab;
Next
Printer.Print
Next
End With
Printer.EndDoc
thanks