R
Ross Culver
Can someone post a link to more indepth samples of formatting a PrintDocument. I've found some info for the ReportViewer, but not for the PrintDocument.
Specifically, I'm looking for a code example of how to underline text in the middle of a document; how to draw a horizontal line and how to draw a box around text.
My guess is that I'm going about this all wrong. Below is a snippet of how I'm setting up the page.
Thanks,
Ross
dim line as string
line = line & Microsoft.VisualBasic.Space(Col1) & Microsoft.VisualBasic.UCase(RTrim(Me.CityStateZipTextBox.Text))
line = line & vbCrLf & vbCrLf & vbCrLf & vbCrLf & vbCrLf & vbCrLf
Do While detCntr <= detCNT
line = line & Me.ShippingLogDetailDataGridView.Rows(detCntr - 1).Cells(4).Value
line = line & Microsoft.VisualBasic.Space(13)
Select Case RTrim(Me.ShippingLogDetailDataGridView.Rows(detCntr - 1).Cells(1).Value.ToString)
Case "F"
line = line & "STAINLESS FITTINGS & FLANGES" & Microsoft.VisualBasic.Space(36)
Case "P", "T"
line = line & "STAINLESS PIPE" & Microsoft.VisualBasic.Space(50)
Case "V"
line = line & "STAINLESS VALVES" & Microsoft.VisualBasic.Space(48)
End Select
detCntr = detCntr + 1
Loop
line = line & Microsoft.VisualBasic.Space(Col1) & Microsoft.VisualBasic.Space(15) & "Customer PO #: " & Microsoft.VisualBasic.UCase(RTrim(Me.CustPOTextBox.Text)) & vbCrLf
line = line & Microsoft.VisualBasic.Space(Col1) & Microsoft.VisualBasic.Space(15) & "Tag #: " & Microsoft.VisualBasic.UCase(RTrim(Me.CustomersCustomersPONOTextBox.Text))& vbCrLf & vbCrLf
yPos = topMargin + count * printFont.GetHeight(ev.Graphics)
ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, New StringFormat())
Specifically, I'm looking for a code example of how to underline text in the middle of a document; how to draw a horizontal line and how to draw a box around text.
My guess is that I'm going about this all wrong. Below is a snippet of how I'm setting up the page.
Thanks,
Ross
dim line as string
line = line & Microsoft.VisualBasic.Space(Col1) & Microsoft.VisualBasic.UCase(RTrim(Me.CityStateZipTextBox.Text))
line = line & vbCrLf & vbCrLf & vbCrLf & vbCrLf & vbCrLf & vbCrLf
Do While detCntr <= detCNT
line = line & Me.ShippingLogDetailDataGridView.Rows(detCntr - 1).Cells(4).Value
line = line & Microsoft.VisualBasic.Space(13)
Select Case RTrim(Me.ShippingLogDetailDataGridView.Rows(detCntr - 1).Cells(1).Value.ToString)
Case "F"
line = line & "STAINLESS FITTINGS & FLANGES" & Microsoft.VisualBasic.Space(36)
Case "P", "T"
line = line & "STAINLESS PIPE" & Microsoft.VisualBasic.Space(50)
Case "V"
line = line & "STAINLESS VALVES" & Microsoft.VisualBasic.Space(48)
End Select
detCntr = detCntr + 1
Loop
line = line & Microsoft.VisualBasic.Space(Col1) & Microsoft.VisualBasic.Space(15) & "Customer PO #: " & Microsoft.VisualBasic.UCase(RTrim(Me.CustPOTextBox.Text)) & vbCrLf
line = line & Microsoft.VisualBasic.Space(Col1) & Microsoft.VisualBasic.Space(15) & "Tag #: " & Microsoft.VisualBasic.UCase(RTrim(Me.CustomersCustomersPONOTextBox.Text))& vbCrLf & vbCrLf
yPos = topMargin + count * printFont.GetHeight(ev.Graphics)
ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, New StringFormat())