Crystal Reports

Crystal Reports requires the HTML tags. Consequently, you must change the report definition itself so that the Optiva pseudo tags are converted to the appropriate HTML tags. For example, the pseudo tags for underline {u} and {/u} are converted to <u> and </u>.

  1. Define a Formula Field for the text that has the font style. For example, the name can be TextDataBold.
  2. Define the conversion script. Here is an example.
     StringVar HoldString;
      HoldString :=Replace ({FSLABELCONTENT.TEXT_DATA}, "{", "<" ); 
     HoldString :=Replace (HoldString, "}", ">" );
     HoldString :=Replace (HoldString, ChrW(13), "<br>" );
     HoldString :=Replace (HoldString, ChrW(10), "<br>" );
    The curly brackets are replaced with the angle brackets.

    Carriage return characters (i.e., line breaks) are replaced with the break <br> tag.

    For backward compatibility, the carriage return (i.e., whitespace characters) are retained in the Optiva database. To separate paragraphs in the report definition, the \n is replaced with <br>.

  3. Add the Formula Field to the report. In Crystal Reports, the Formula Field name is displayed as @TextDataBold.
  4. Open the Format Editor. In the Paragraph tab for the @TextDataBold value, select Text Interpretation: HTML.
    There is one column in the database table for your Label Content preview, which becomes one attribute in the XML that is exported to Crystal. It is referenced by "FSLABELCONTENT.TEXT_DATA" in this script.

    TextDataBold is the name of the Crystal formula that operates on the entire block of text. This is regardless of the number of paragraphs it contains. The Crystal formula is not an Optiva formula.

    The variable named @TextDataBold is used to position the resulting output from the formula on the report itself. It also contains the entire block of text, regardless of the number of paragraphs. The only difference being that the paragraph breaks have been changed to <br> tags. These tags create a new line when interpreted as HTML.