RTF text does not format correctly in a header

Posted by: pshinohara on 8 September 2017, 12:54 pm EST

  • Posted 8 September 2017, 12:54 pm EST

    From an RTF text string, I converted it to normal text so I can add it to a header & print it.

    string siteAddress;

    string disclaimer;

    using (RichTextBox rtf = new RichTextBox())


    rtf.Rtf = rtfSiteAddress; //rtf SiteAddress contains RTF text

    siteAddress = rtf.Text; //get normal text


    rtf.Rtf = rtfDisclaimer; //rtfDisliamer contains RTF text

    disclaimer = rtf.Text; //get normal text


    FarPoint.Win.Spread.PrintInfo pInfo = new PrintInfo();

    pInfo.Header = "/fn\"Arial\"/fz\"12\"Vaccine Administration Record/n" + "Patient: " + patient.Person.Name + "/nRecord Number: " + patient.MedicalRecordNumber + "/nBirth Date: " + patient.Person.Birthdate.ToShortDateString() + "/n" + siteAddress + "/n" + disclaimer;

    It does not print as expected when it prints the siteAddress & disclaimer.  The newlines do not seem to be taking effect.  I must also say that the siteAddress & disclaimer text has embedded newline chars ('\n') for formatting purposes.  Perhaps this is causing the problem?



  • Replied 8 September 2017, 12:54 pm EST

    What is siteAddress actually set to?
  • Replied 8 September 2017, 12:54 pm EST

    siteAddress has text that has embedded '\n' characters which I converted to '/n'.  To force multiple newlines, I added multiple /n  such as - "ipsum lorem dolor /n/n/n abcdefgh" thinking it would give me 3 new lines (carriage returns) but it is not doing that.  It is only still in effect giving me 1 newline.

    Are multiple successive '/n' characters possible in a header?

  • Replied 8 September 2017, 12:54 pm EST


    I was able to reproduce this issue and have reported this as a bug (#21852) for the development team to fix for the next maintenance release. For now, you can workaround this issue by puttin a space between each /n escape code.

    "Line1/n /n /nLine2"

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels