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

    <P>From an RTF text string, I converted it to normal text so I can add it to a header & print it.</P><FONT color=#0000ff size=2>
    <P>string siteAddress;</P>
    <P>string disclaimer;</P>
    <P>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></P>
    <P><FONT size=2>{</P>
    <P>rtf.Rtf = rtfSiteAddress; //rtf SiteAddress contains RTF text</P>
    <P>siteAddress = rtf.Text; //get normal text</P>
    <P>rtf.Rtf = rtfDisclaimer; //rtfDisliamer contains RTF text</P>
    <P>disclaimer = rtf.Text; //get normal text</P>
    <P>}</P></FONT><FONT size=2>
    <P>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></P>
    <P><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></P>
    <P><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></P>
    <P><FONT size=2></FONT> </P>
    <P><FONT size=2> </P></FONT>
  • Replied 8 September 2017, 12:54 pm EST

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

    <P>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.</P>
    <P>Are multiple successive '/n' characters possible in a header?</P>
  • Replied 8 September 2017, 12:54 pm EST

    <P>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.</P>
    <P>"Line1/n /n /nLine2"</P>
Need extra support?

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

Learn More

Forum Channels