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.

    <FONT color=#0000ff size=2>

    string siteAddress;

    string disclaimer;

    using</FONT><FONT size=2> (</FONT><FONT color=#2b91af size=2>RichTextBox</FONT><FONT size=2> rtf = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>RichTextBox</FONT><FONT size=2>())</FONT>

    <FONT size=2>{

    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


    </FONT><FONT size=2>

    FarPoint.Win.Spread.</FONT><FONT color=#2b91af size=2>PrintInfo</FONT><FONT size=2> pInfo = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>PrintInfo</FONT><FONT size=2>();</FONT>

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

    <FONT size=2>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?</FONT>

    <FONT size=2></FONT> 

    <FONT size=2> 

  • 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