SAP Knowledge Base Article - Public

1517533 - Text not properly aligned when using HTML Text Interpretation in Crystal Reports

Symptom

  • Text not aligned.
  • When displaying a list of items, if the text of one item is long, the text is misaligned on the next line.
  • When using the HTML tags <ul><li>text</li></ul> to display a list of items in Crystal Reports, if the text doesn't fit on one line, it will show the text on the second line shifted towards the left.

Environment

  • SAP Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016
          
  • SAP Crystal Reports for Enterprise 4.0
  • SAP Crystal Reports for Enterprise 4.1
  • SAP Crystal Reports for Enterprise 4.2

Reproducing the Issue

  1. In Crystal Reports, create a report off any data source.
       
  2. Create a formula that uses HTML code to format text to display a list of items like:
     
      <HTML><ul><li>First Item.</li><li>This is a long sentence, which will wrap on a second line.</li></ul></HTML>
       
  3. Insert the the formula on the report.
     
  4. Format the formula to display the text in HTML format.
    • Right click on the formula and select"Format Field".
    • In the Format Editor window, under the tab Paragraph, select for "Text Interpretation", the option: "HTML Text".
    • Under the tab: "Common", check the option; "Can Grow".
    • Click "OK" to accept the change.
           
  5. When previewing the report, notice the item that have long text wrap on a second line on the left like:
    HTML Output.png
  6. When the expectation is to see the second line of text to align right underneath the item like:
    HTML Output.png

Cause

  • The behavior is a limitation of the HTML tag <li> when using HTML Text Interpretation in Crystal Reports. ( ADAPT01482473 )

Resolution

  • There is unfortunately no workaround to align the text that wrap on a second line when using list of item when formatting text using HTML Text Interpretation.

Keywords

cr, crystal report, HTML, text, aligned, text interpretation , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Bug Filed

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016