Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing String Builder With Form Feed Not Working

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
0
36
US
I'm using string builder to create some text file reports. I can add a CrLf using
Code:
stbReport.Append("REPORT TOTAL".PadRight(15) _
          + New String(" "c, 59) _
          + RptPayTotal.ToString("#####,##0.00").PadLeft(12) _
          + ControlChars.CrLf)
But when I add
Code:
stbReport.Append(ControlChars.FormFeed)
it is not doing a form feed when I print with the following code where txtReport.Text contains the text from stbReport.ToString
Code:
Dim myPrintObject As TextPrint = New TextPrint(txtReport.Text)
    Dim dlg As New PrintDialog
    dlg.Document = myPrintObject

    Dim Result As DialogResult = dlg.ShowDialog

    If (Result = System.Windows.Forms.DialogResult.OK) Then
      If ReportLayout = "LANDSCAPE" Then
        myPrintObject.DefaultPageSettings.Landscape = True
      Else
        myPrintObject.DefaultPageSettings.Landscape = False
      End If
      myPrintObject.Font = New Font("Courier New", ReportFont2)
      myPrintObject.Print()
    End If
Any way to make this work?



Auguy
Sylvania/Toledo Ohio
 
Anybody have any ideas or alternatives? Thanks

Auguy
Sylvania/Toledo Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top