This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C87491.D2C9CE60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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 =3D line & Microsoft.VisualBasic.Space(Col1) & =
Microsoft.VisualBasic.UCase(RTrim(Me.CityStateZipTextBox.Text))
line =3D line & vbCrLf & vbCrLf & vbCrLf & vbCrLf & vbCrLf & vbCrLf
Do While detCntr <=3D detCNT
line =3D line & Me.ShippingLogDetailDataGridView.Rows(detCntr - =
1).Cells(4).Value
line =3D line & Microsoft.VisualBasic.Space(13)
Select Case RTrim(Me.ShippingLogDetailDataGridView.Rows(detCntr - =
1).Cells(1).Value.ToString)
Case "F"
line =3D line & "STAINLESS FITTINGS & FLANGES" & =
Microsoft.VisualBasic.Space(36)
Case "P", "T"
line =3D line & "STAINLESS PIPE" & =
Microsoft.VisualBasic.Space(50)
Case "V"
line =3D line & "STAINLESS VALVES" & =
Microsoft.VisualBasic.Space(48)
End Select
detCntr =3D detCntr + 1
Loop
line =3D line & Microsoft.VisualBasic.Space(Col1) & =
Microsoft.VisualBasic.Space(15) & "Customer PO #: " & =
Microsoft.VisualBasic.UCase(RTrim(Me.CustPOTextBox.Text)) & vbCrLf
line =3D line & Microsoft.VisualBasic.Space(Col1) & =
Microsoft.VisualBasic.Space(15) & "Tag #: " & =
Microsoft.VisualBasic.UCase(RTrim(Me.CustomersCustomersPONOTextBox.Text))=
& vbCrLf & vbCrLf
yPos =3D topMargin + count * printFont.GetHeight(ev.Graphics)
ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, =
New StringFormat())
------=_NextPart_000_0006_01C87491.D2C9CE60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16608" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Can someone post a link to more indepth =
samples of=20
formatting a PrintDocument. I've found some info for the =
ReportViewer, but=20
not for the PrintDocument.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Specifically, I'm looking for a code =
example of how=20
to underline text in the middle of a document; how to draw a horizontal =
line and=20
how to draw a box around text.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>My guess is that I'm going about this =
all=20
wrong. Below is a snippet of how I'm setting up the =
page.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Ross</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>dim line as =
string</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>line =3D line &=20
Microsoft.VisualBasic.Space(Col1) &=20
Microsoft.VisualBasic.UCase(RTrim(Me.CityStateZipTextBox.Text))</FONT></D=
IV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>line =3D line & =
vbCrLf & vbCrLf=20
& vbCrLf & vbCrLf & vbCrLf & vbCrLf</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>Do While detCntr =
<=3D=20
detCNT</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2> line =3D line =
&=20
Me.ShippingLogDetailDataGridView.Rows(detCntr - =
1).Cells(4).Value</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2> line =3D line =
&=20
Microsoft.VisualBasic.Space(13)</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2> Select Case=20
RTrim(Me.ShippingLogDetailDataGridView.Rows(detCntr -=20
1).Cells(1).Value.ToString)</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2> =
Case=20
"F"</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2> =
=20
line =3D line & "STAINLESS FITTINGS & FLANGES" &=20
Microsoft.VisualBasic.Space(36)</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2> =
Case "P",=20
"T"</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2> =
=20
line =3D line & "STAINLESS PIPE" &=20
Microsoft.VisualBasic.Space(50)</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2> =
Case=20
"V"</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2> =
=20
line =3D line & "STAINLESS VALVES" &=20
Microsoft.VisualBasic.Space(48)</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2> =
End=20
Select</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial color=3D#0000ff =
size=3D2> detCntr=20
=3D detCntr + 1</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>Loop</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>line =3D line &=20
Microsoft.VisualBasic.Space(Col1) & Microsoft.VisualBasic.Space(15) =
&=20
"Customer PO #: " &=20
Microsoft.VisualBasic.UCase(RTrim(Me.CustPOTextBox.Text)) &=20
vbCrLf</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>line =3D line &=20
Microsoft.VisualBasic.Space(Col1) & Microsoft.VisualBasic.Space(15) =
&=20
"Tag #: " &=20
Microsoft.VisualBasic.UCase(RTrim(Me.CustomersCustomersPONOTextBox.Text))=
&=20
vbCrLf & vbCrLf</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>yPos =3D topMargin + =
count *=20
printFont.GetHeight(ev.Graphics)</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff =
size=3D2>ev.Graphics.DrawString(line,=20
printFont, Brushes.Black, leftMargin, yPos, New=20
StringFormat())</FONT></DIV></BODY></HTML>
------=_NextPart_000_0006_01C87491.D2C9CE60--