Как сделать таблицу в VB.NET печать документа
Привет я хочу сделать отчет документ в vb.net но мне не удается создать таблицу в документе. Im новое в печатный документ в VB и им, используя основные коды на печать.
Я хочу, чтобы печатный документ выглядел так
1 — imgbb.com[^]
Что я уже пробовал:
Вот что я пытался сделать:
2 — imgbb.com[^]
Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage Dim ReportFont As Font = New Drawing.Font("Bebas Neue", 16) Dim ReportBodyFont As Font = New Drawing.Font("Bebas Neue", 6) 'Report' e.Graphics.DrawImage(My.Resources.logodgn, 580, 10, 220, 50) e.Graphics.DrawString("SERVICE COMPLETION REPORT", ReportFont, Brushes.Red, 220, 40) e.Graphics.DrawString("Date: ", ReportFont, Brushes.Black, 450, 90) e.Graphics.DrawString(datePicker.Text, ReportFont, Brushes.Blue, 510, 90) e.Graphics.DrawString("Client: ", ReportFont, Brushes.Black, 50, 130) e.Graphics.DrawString(clientNameText.Text, ReportFont, Brushes.Blue, 120, 130) e.Graphics.DrawString("Time Started: ", ReportFont, Brushes.Black, 550, 130) e.Graphics.DrawString(timeStartedText.Text, ReportFont, Brushes.Blue, 680, 130) e.Graphics.DrawString("Contact Person: ", ReportFont, Brushes.Black, 50, 160) e.Graphics.DrawString(cPersonText.Text, ReportFont, Brushes.Blue, 210, 160) e.Graphics.DrawString("Time Ended: ", ReportFont, Brushes.Black, 550, 160) e.Graphics.DrawString(timeEndedText.Text, ReportFont, Brushes.Blue, 680, 160) '' e.Graphics.DrawString("Dear Sir/Madame: ", ReportFont, Brushes.Black, 50, 210) e.Graphics.DrawString("Please acknowledge completion of service rendered.", ReportFont, Brushes.Black, 50, 250) e.Graphics.DrawString("Kindly see this presented form for particulars of areas covered and ", ReportFont, Brushes.Black, 50, 280) e.Graphics.DrawString("done by our service and use of our technology.", ReportFont, Brushes.Black, 50, 310) '' e.Graphics.DrawString("Doclogging", ReportFont, Brushes.Black, 50, 360) e.Graphics.DrawString("Quantity", ReportFont, Brushes.Black, 220, 360) e.Graphics.DrawString("Clogged", ReportFont, Brushes.Black, 330, 360) e.Graphics.DrawString("Findings/Remarks", ReportFont, Brushes.Black, 470, 360) '' e.Graphics.DrawString("Floor Drain", ReportFont, Brushes.Green, 50, 400) e.Graphics.DrawString(fldQuantityText.Text, ReportFont, Brushes.Blue, 220, 400) e.Graphics.DrawString(fldClText.Text, ReportFont, Brushes.Blue, 330, 400) e.Graphics.DrawString(fldFinRecText.Text, ReportFont, Brushes.Blue, 470, 400) '' e.Graphics.DrawString("Grease Trap", ReportFont, Brushes.Green, 50, 430) e.Graphics.DrawString(grtQuantityText.Text, ReportFont, Brushes.Blue, 220, 430) e.Graphics.DrawString(grtClText.Text, ReportFont, Brushes.Blue, 330, 430) e.Graphics.DrawString(grtFinRecText.Text, ReportFont, Brushes.Blue, 470, 430) '' e.Graphics.DrawString("Clean Out", ReportFont, Brushes.Green, 50, 460) e.Graphics.DrawString(coQuantityText.Text, ReportFont, Brushes.Blue, 220, 460) e.Graphics.DrawString(coClText.Text, ReportFont, Brushes.Blue, 330, 460) e.Graphics.DrawString(coFinRecText.Text, ReportFont, Brushes.Blue, 470, 460) '' e.Graphics.DrawString("Kitchen Cleaning", ReportFont, Brushes.Black, 50, 490) '' e.Graphics.DrawString("Range", ReportFont, Brushes.Green, 50, 520) e.Graphics.DrawString(rngQuantityText.Text, ReportFont, Brushes.Blue, 220, 520) e.Graphics.DrawString(rngClText.Text, ReportFont, Brushes.Blue, 330, 520) e.Graphics.DrawString(rngFinRecText.Text, ReportFont, Brushes.Blue, 470, 520) '' e.Graphics.DrawString("Oven", ReportFont, Brushes.Green, 50, 550) e.Graphics.DrawString(ovnQuantityText.Text, ReportFont, Brushes.Blue, 220, 550) e.Graphics.DrawString(ovnClText.Text, ReportFont, Brushes.Blue, 330, 550) e.Graphics.DrawString(ovnFinRecText.Text, ReportFont, Brushes.Blue, 470, 550) '' e.Graphics.DrawString("Grill", ReportFont, Brushes.Green, 50, 580) e.Graphics.DrawString(grlQuantityText.Text, ReportFont, Brushes.Blue, 220, 580) e.Graphics.DrawString(grlClText.Text, ReportFont, Brushes.Blue, 330, 580) e.Graphics.DrawString(grlFinRecText.Text, ReportFont, Brushes.Blue, 470, 580) '' e.Graphics.DrawString("Deep-fryer", ReportFont, Brushes.Green, 50, 610) e.Graphics.DrawString(dpfQuantityText.Text, ReportFont, Brushes.Blue, 220, 610) e.Graphics.DrawString(dpfClText.Text, ReportFont, Brushes.Blue, 330, 610) e.Graphics.DrawString(dpfFinRecText.Text, ReportFont, Brushes.Blue, 470, 610) '' e.Graphics.DrawString("Hoods", ReportFont, Brushes.Green, 50, 640) e.Graphics.DrawString(hdsQuantityText.Text, ReportFont, Brushes.Blue, 220, 640) e.Graphics.DrawString(hdsClText.Text, ReportFont, Brushes.Blue, 330, 640) e.Graphics.DrawString(hdsFinRecText.Text, ReportFont, Brushes.Blue, 470, 640) '' e.Graphics.DrawString("D&G Pacific Personnel", ReportFont, Brushes.Black, 300, 700) e.Graphics.DrawString("1. " + pCB1.Text, ReportFont, Brushes.Blue, 50, 730) e.Graphics.DrawString("2. " + pCB2.Text, ReportFont, Brushes.Blue, 50, 760) e.Graphics.DrawString("3. " + pCB3.Text, ReportFont, Brushes.Blue, 50, 790) e.Graphics.DrawString("4. " + pCB4.Text, ReportFont, Brushes.Blue, 470, 730) e.Graphics.DrawString("5. " + pCB5.Text, ReportFont, Brushes.Blue, 470, 760) e.Graphics.DrawString("6. " + pCB6.Text, ReportFont, Brushes.Blue, 470, 790) '' e.Graphics.DrawString("Service Rendered:", ReportFont, Brushes.Black, 50, 830) e.Graphics.DrawString("Client Remarks", ReportFont, Brushes.Black, 350, 830) e.Graphics.DrawString("Service Grade", ReportFont, Brushes.Black, 650, 830) 'Service Rendered' e.Graphics.DrawString("▢ Kitchen Cleaning", ReportFont, Brushes.Black, 50, 860) e.Graphics.DrawString("▢ De-clogging", ReportFont, Brushes.Black, 50, 890) e.Graphics.DrawString("▢ Duct Cleaning", ReportFont, Brushes.Black, 50, 920) e.Graphics.DrawString("Other", ReportFont, Brushes.Black, 50, 950) e.Graphics.DrawString("_____________", ReportFont, Brushes.Black, 50, 980) 'Client Remarks' e.Graphics.DrawString("_____________________", ReportFont, Brushes.Black, 275, 860) e.Graphics.DrawString("_____________________", ReportFont, Brushes.Black, 275, 890) e.Graphics.DrawString("_____________________", ReportFont, Brushes.Black, 275, 920) 'Service Grade' e.Graphics.DrawString("__________", ReportFont, Brushes.Black, 650, 920) e.Graphics.DrawString("*Range of 1-10.", ReportFont, Brushes.Black, 600, 950) e.Graphics.DrawString("10 Being highest", ReportFont, Brushes.Black, 600, 980) 'Signature' e.Graphics.DrawString("____________________", ReportFont, Brushes.Black, 300, 1050) e.Graphics.DrawString("Signature over printed name", ReportFont, Brushes.Black, 275, 1100) End Sub