I printed a text containing several "\", but "\ S" turned into "1",

So, I have a C1TrueDBGrid in my form (which is a ComponentOne control), and I give the user the ability to print the contents of the grid.

When printing, I include a headline with some text. This is my printable code:

    Dim dlgPrint As New PrintDialog
    dlgPrint.ShowDialog()

    dgvList.PrintInfo.PrintEmptyGrid = False
    dgvList.PrintInfo.PageHeader = txtDirectory.Text & Environment.NewLine & "Search Term: " & txtSearch.Text & Environment.NewLine
    dgvList.PrintInfo.PageSettings.Landscape = True
    dgvList.PrintInfo.WrapText = C1.Win.C1TrueDBGrid.PrintInfo.WrapTextEnum.Wrap
    dgvList.PrintInfo.RepeatColumnHeaders = True

    dgvList.PrintInfo.Print(dlgPrint.PrinterSettings)

    dlgPrint.Dispose()

txtDirectory.Text, as I am sure you can imagine, contains a directory path that includes backslashes \. What was actually printed turned \ S instances into 1.

For example: txtDirectory.Text = \\ Server02 \ Users \ Me \ J \ Star

which was printed = \ 1erver02 \ Users \ Me \ J1tar

"\ S" "1" - ? -, , ? , ?

!

+4
2

ComponentOne.

, , , printText, :

    printText.Replace("\t", "\\t")
    printText.Replace("\p", "\\p")
    printText.Replace("\P", "\\P")
    printText.Replace("\g", "\\g")
    printText.Replace("\G", "\\G")
    printText.Replace("\s", "\\s")
    printText.Replace("\S", "\\S")

, "\\ t" , ... .

@DonBoitnott !

0

PageHeader, ComponentOne, \S - , - "1" . .

+1

All Articles