SAP Knowledge Base Article - Public

1655893 - How to apply different font styles to database fields in Crystal Reports using HTML Text Interpretation?

Symptom

  • How to format text with different font styles?
  • How to format text in italic, underline and bold in one string in Cystal Reports?
  • How to display different Font Styles for concatenated fields using HTML tags in Crystal Reports?

Environment

  • SAP Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Resolution

  • To apply different font styles to database fields use HTML Tags, and format the field to use HTML Text Interpretation:
        
    1. In Crystal Reports, open the report or create a new report.
         
    2. Create a formula to and add the database fields you want to apply different font styles, and add HTML Tags for the different font styles.
      Below is an example of a formula that concatenate three fields, and format:
      - The first one with underline, using the html tag: <u>
      - The the second one in italic, using the html tag: <i>
      - And the third one in bold, using the html tag: <b>
            
              '<u>' + {Customer.City} + '</u>  <i>' + {Customer.Region} + '<i/> <b>' + {Customer.Country} + '<b/>'
              
    3. Save the formula and insert it on the report.
          
    4. Right click on the Formula Field just inserted on the report, and select "Format Field..."
        
    5. In the "Format Editor" window, under the tab "Paragraph", set the "Text interpretation" option to: "HTML"
        
        HTML Text Option.png
           
        
    6. Click "OK" to accept the change.
       
          
  • Sample report demonstrating the above example: Multiple Font Styles.rpt
         
  • For a list of supported HTML Tags to format the text, see the SAP Knowledge Base Article: 1217084

Keywords

Bold, Italic fonts in crystal reports, HTML text, Text interpretation , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

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

Attachments

Multiple Font Styles.rpt