private void docPrint_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawLine(new Pen(Color.Black, 2), 60, 90, 680, 90);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 60, 93, 680, 93);
string strDisplay = "College Park Auto Repair";
System.Drawing.Font fntString = new Font("Times New Roman", 28,
FontStyle.Bold);
e.Graphics.DrawString(strDisplay, fntString,
Brushes.Black, 160, 100);
strDisplay = "Customer Car Repair Order";
fntString = new System.Drawing.Font("Times New Roman", 18,
FontStyle.Bold);
e.Graphics.DrawString(strDisplay, fntString,
Brushes.Black, 220, 150);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 60, 184, 680, 184);
e.Graphics.DrawLine(new Pen(Color.Black, 2), 60, 187, 680, 187);
fntString = new System.Drawing.Font("Times New Roman", 12,
FontStyle.Bold);
e.Graphics.DrawString("Order Identification", fntString,
Brushes.Black, 80, 200);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 250, 640, 250);
fntString = new System.Drawing.Font("Times New Roman", 10,
FontStyle.Bold);
e.Graphics.DrawString("Customer Name:", fntString,
Brushes.Black, 100, 260);
fntString = new System.Drawing.Font("Times New Roman", 10,
FontStyle.Regular);
e.Graphics.DrawString(txtCustomerName.Text, fntString,
Brushes.Black, 260, 260); ;
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 280, 640, 280);
fntString = new Font("Times New Roman", 10, FontStyle.Bold);
e.Graphics.DrawString("Address:", fntString,
Brushes.Black, 100, 290);
fntString = new Font("Times New Roman", 10, FontStyle.Regular);
e.Graphics.DrawString(txtAddress.Text, fntString,
Brushes.Black, 260, 290); ;
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 310, 640, 310);
fntString = new Font("Times New Roman", 10, FontStyle.Regular);
string strAddress = txtCity.Text.ToString() + ", " +
txtState.Text + " " + txtZIPCode.Text;
e.Graphics.DrawString(strAddress, fntString, Brushes.Black, 260, 320);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 340, 640, 340);
fntString = new Font("Times New Roman", 10, FontStyle.Bold);
e.Graphics.DrawString("Car:", fntString, Brushes.Black, 100, 350);
fntString = new Font("Times New Roman", 10, FontStyle.Regular);
string strCar = txtMake.Text + ", " + txtModel.Text +
", " + txtCarYear.Text;
e.Graphics.DrawString(strCar, fntString, Brushes.Black, 260, 350);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 370, 640, 370);
fntString = new Font("Times New Roman", 10, FontStyle.Bold);
e.Graphics.DrawString("Problem Description:", fntString,
Brushes.Black, 100, 380);
fntString = new Font("Times New Roman", 10, FontStyle.Regular);
e.Graphics.DrawString(txtProblem.Text, fntString,
Brushes.Black,
new RectangleF(260, 380, 420, 380));
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 400, 640, 400);
fntString = new System.Drawing.Font("Times New Roman", 12,
FontStyle.Bold);
e.Graphics.DrawString("Parts Used", fntString,
Brushes.Black, 80, 430);
e.Graphics.DrawLine(new Pen(Color.Black, 2), 80, 450, 680, 450);
e.Graphics.DrawString("Parts Name", fntString,
Brushes.Black, 100, 460);
e.Graphics.DrawString("Unit Price", fntString,
Brushes.Black, 420, 460);
e.Graphics.DrawString("Qty", fntString,
Brushes.Black, 520, 460);
e.Graphics.DrawString("Sub-Total", fntString,
Brushes.Black, 562, 460);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 480, 640, 480);
fntString = new Font("Times New Roman", 10, FontStyle.Regular);
StringFormat fmtString = new StringFormat();
fmtString.Alignment = StringAlignment.Far;
e.Graphics.DrawString(txtPartName1.Text, fntString,
Brushes.Black, 100, 490);
e.Graphics.DrawString(txtUnitPrice1.Text, fntString,
Brushes.Black, 480, 490, fmtString);
e.Graphics.DrawString(txtQuantity1.Text, fntString,
Brushes.Black, 540, 490, fmtString);
e.Graphics.DrawString(txtSubTotal1.Text, fntString,
Brushes.Black, 630, 490, fmtString);
e.Graphics.DrawLine(new Pen(Color.Black, 1),
100, 510, 640, 510);
e.Graphics.DrawString(txtPartName2.Text, fntString,
Brushes.Black, 100, 520);
e.Graphics.DrawString(txtUnitPrice2.Text, fntString,
Brushes.Black, 480, 520, fmtString);
e.Graphics.DrawString(txtQuantity2.Text, fntString,
Brushes.Black, 540, 520, fmtString);
e.Graphics.DrawString(txtSubTotal2.Text, fntString,
Brushes.Black, 630, 520, fmtString);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 540, 640, 540);
e.Graphics.DrawString(txtPartName3.Text, fntString,
Brushes.Black, 100, 550);
e.Graphics.DrawString(txtUnitPrice3.Text, fntString,
Brushes.Black, 480, 550, fmtString);
e.Graphics.DrawString(txtQuantity3.Text, fntString,
Brushes.Black, 540, 550, fmtString);
e.Graphics.DrawString(txtSubTotal3.Text, fntString,
Brushes.Black, 630, 550, fmtString);
e.Graphics.DrawLine(new Pen(Color.Black, 1),
100, 570, 640, 570);
e.Graphics.DrawString(txtPartName4.Text, fntString,
Brushes.Black, 100, 580);
e.Graphics.DrawString(txtUnitPrice4.Text, fntString,
Brushes.Black, 480, 580, fmtString);
e.Graphics.DrawString(txtQuantity4.Text, fntString,
Brushes.Black, 540, 580, fmtString);
e.Graphics.DrawString(txtSubTotal4.Text, fntString,
Brushes.Black, 630, 580, fmtString);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 600, 640, 600);
e.Graphics.DrawString(txtPartName5.Text, fntString,
Brushes.Black, 100, 610);
e.Graphics.DrawString(txtUnitPrice5.Text, fntString,
Brushes.Black, 480, 610, fmtString);
e.Graphics.DrawString(txtQuantity5.Text, fntString,
Brushes.Black, 540, 610, fmtString);
e.Graphics.DrawString(txtSubTotal5.Text, fntString,
Brushes.Black, 630, 610, fmtString);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 630, 640, 630);
fntString = new Font("Times New Roman", 12, FontStyle.Bold);
e.Graphics.DrawString("Jobs Performed", fntString,
Brushes.Black, 80, 650);
e.Graphics.DrawLine(new Pen(Color.Black, 2), 80, 670, 680, 670);
e.Graphics.DrawString("Job Name", fntString, Brushes.Black, 100, 680);
e.Graphics.DrawString("Price", fntString, Brushes.Black, 562, 680);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 700, 640, 700);
fntString = new Font("Times New Roman", 10, FontStyle.Regular);
e.Graphics.DrawString(txtJobDescription1.Text, fntString,
Brushes.Black, 100, 710);
e.Graphics.DrawString(txtJobPrice1.Text, fntString,
Brushes.Black, 600, 710, fmtString);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 730, 640, 730);
e.Graphics.DrawString(txtJobDescription2.Text, fntString,
Brushes.Black, 100, 740);
e.Graphics.DrawString(txtJobPrice2.Text, fntString,
Brushes.Black, 600, 740, fmtString);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 760, 640, 760);
e.Graphics.DrawString(txtJobDescription3.Text, fntString,
Brushes.Black, 100, 770);
e.Graphics.DrawString(txtJobPrice3.Text, fntString,
Brushes.Black, 600, 770, fmtString);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 790, 640, 790);
e.Graphics.DrawString(txtJobDescription4.Text, fntString,
Brushes.Black, 100, 800);
e.Graphics.DrawString(txtJobPrice4.Text, fntString,
Brushes.Black, 600, 800, fmtString);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 820, 640, 820);
e.Graphics.DrawString(txtJobDescription5.Text, fntString,
Brushes.Black, 100, 830);
e.Graphics.DrawString(txtJobPrice5.Text, fntString,
Brushes.Black, 600, 830, fmtString);
e.Graphics.DrawLine(new Pen(Color.Black, 1), 100, 850, 640, 850);
fntString = new System.Drawing.Font("Times New Roman", 12, FontStyle.Bold);
e.Graphics.DrawString("Order Summary", fntString,
Brushes.Black, 80, 870);
e.Graphics.DrawLine(new Pen(Color.Black, 2), 80, 890, 680, 890);
fntString = new System.Drawing.Font("Times New Roman", 10, FontStyle.Bold);
e.Graphics.DrawString("Total Parts:", fntString,
Brushes.Black, 500, 900);
fntString = new System.Drawing.Font("Times New Roman", 10,
FontStyle.Regular);
e.Graphics.DrawString(txtTotalParts.Text, fntString,
Brushes.Black, 640, 900, fmtString);
fntString = new System.Drawing.Font("Times New Roman", 10, FontStyle.Bold);
e.Graphics.DrawString("Total Labor:", fntString,
Brushes.Black, 500, 920);
fntString = new System.Drawing.Font("Times New Roman", 10,
FontStyle.Regular);
e.Graphics.DrawString(txtTotalLabor.Text, fntString,
Brushes.Black, 640, 920, fmtString);
fntString = new System.Drawing.Font("Times New Roman", 10, FontStyle.Bold);
e.Graphics.DrawString("Tax Rate:", fntString,
Brushes.Black, 500, 940);
fntString = new System.Drawing.Font("Times New Roman", 10,
FontStyle.Regular);
e.Graphics.DrawString(txtTaxRate.Text, fntString,
Brushes.Black, 640, 940, fmtString);
fntString = new System.Drawing.Font("Times New Roman", 10, FontStyle.Bold);
e.Graphics.DrawString("Tax Amount:", fntString,
Brushes.Black, 500, 960);
fntString = new System.Drawing.Font("Times New Roman", 10,
FontStyle.Regular);
e.Graphics.DrawString(txtTaxAmount.Text, fntString,
Brushes.Black, 640, 960, fmtString);
fntString = new System.Drawing.Font("Times New Roman", 10, FontStyle.Bold);
e.Graphics.DrawString("Repair Total:", fntString,
Brushes.Black, 500, 980);
fntString = new System.Drawing.Font("Times New Roman", 10,
FontStyle.Regular);
e.Graphics.DrawString(txtTotalOrder.Text, fntString,
Brushes.Black, 640, 980, fmtString);
fntString = new System.Drawing.Font("Times New Roman", 10, FontStyle.Bold);
e.Graphics.DrawString("Recommendations:", fntString,
Brushes.Black, 100, 900);
fntString = new System.Drawing.Font("Times New Roman", 10,
FontStyle.Regular);
e.Graphics.DrawString(txtRecommendations.Text, fntString,
Brushes.Black, new RectangleF(100, 920, 350, 280));
}
|