Question
Errors are bold. I need text file to print when the button is clicked Private Sub PrintToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PrintToolStripMenuItem.Click PrintDocumentControl.Print()
Errors are bold. I need text file to print when the button is clicked
Private Sub PrintToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PrintToolStripMenuItem.Click PrintDocumentControl.Print() End Sub
Private Sub printCustomerData_PrintPage(sender As Object, e As Printing.PrintPageEventArgs)
Handle PrintDocumentControl.Print()
Dim count As Integer = 0 Dim intVertPos As Integer e.Graphics.DrawString("Report Customer Accounts with Balances", New Font("Courier New", 14, FontStyle.Bold), Brushes.Black, 200, 10) intVertPos = 50 Try 'Printing page set up for all the information While Not searchFile.EndOfStream If count = 10 Then count = 0 intVertPos += 20 Else e.Graphics.DrawString(String.Format("{0,20}{1,10}", "First Name:", searchFile.ReadLine()), New Font("Courier New", 12, FontStyle.Regular), Brushes.Black, 15, intVertPos) intVertPos += 15 e.Graphics.DrawString(String.Format("{0,20}{1,10}", "Last Name:", searchFile.ReadLine()), New Font("Courier New", 12, FontStyle.Regular), Brushes.Black, 15, intVertPos) intVertPos += 15 count += 1 e.Graphics.DrawString(String.Format("{0,20}{1,10}", "Customer Number:", searchFile.ReadLine()), New Font("Courier New", 12, FontStyle.Regular), Brushes.Black, 15, intVertPos) intVertPos += 15 count += 1 e.Graphics.DrawString(String.Format("{0,20}{1,10}", "Address:", searchFile.ReadLine()), New Font("Courier New", 12, FontStyle.Regular), Brushes.Black, 15, intVertPos) intVertPos += 15 count += 1 e.Graphics.DrawString(String.Format("{0,20}{1,10}", "City:", searchFile.ReadLine()), New Font("Courier New", 12, FontStyle.Regular), Brushes.Black, 15, intVertPos) intVertPos += 15 count += 1 e.Graphics.DrawString(String.Format("{0,20}{1,10}", "State:", searchFile.ReadLine()), New Font("Courier New", 12, FontStyle.Regular), Brushes.Black, 15, intVertPos) intVertPos += 15 count += 1 e.Graphics.DrawString(String.Format("{0,20}{1,10}", "Zip Code:", searchFile.ReadLine()), New Font("Courier New", 12, FontStyle.Regular), Brushes.Black, 15, intVertPos) intVertPos += 15 count += 1 e.Graphics.DrawString(String.Format("{0,20}{1,10}", "Telephone Number:", searchFile.ReadLine()), New Font("Courier New", 12, FontStyle.Regular), Brushes.Black, 15, intVertPos) intVertPos += 15 count += 1 e.Graphics.DrawString(String.Format("{0,20}{1,10}", "Account Balance:", searchFile.ReadLine()), New Font("Courier New", 12, FontStyle.Regular), Brushes.Black, 15, intVertPos) intVertPos += 15 count += 1 e.Graphics.DrawString(String.Format("{0,20}{1,10}", "Date of Last Payment:", searchFile.ReadLine()), New Font("Courier New", 12, FontStyle.Regular), Brushes.Black, 15, intVertPos) intVertPos += 15 count += 1 End If End While Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started