Symptom
- Columns alignment incorrect.
- Columns are not aligned the same way in Crystal Reports than in MS Word.
- In Crystal Reports, when reporting off a database field containing Rich Text Format (RTF) Code, the columns do not line up as they do in Microsoft Word and WordPad. The database field has RTF Text Interpretation selected in Crystal Reports and tabs are used within the RTF code to generate columns.
"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."
Environment
- Crystal Reports 2008
- SAP Crystal Reports 2011
- SAP Crystal Reports 2013
- SAP Crystal Reports 2016
Reproducing the Issue
- In Crystal Reports, create a report off any data source.
- Create a formula that contains RTF tags that uses multiple tabs tags (/tab), to align text in columns, like:
'{\rtf1\ansi{\fonttbl\f0 Arial;}Jane\tab\tab\tab 123\par John\tab\tab\tab 456\par Max\tab\tab\tab 789}\f0}'
- Insert the formula on the report, and set the Text Interpretation format to RTF.
- When viewing the report in Crystal Reports, it display the RTF text like:
- When viewing the same RTF text in MS Word, it displays the text like:
Notice the tab alignment is different in Crystal Reports, than it is in MS Word:
Cause
- Columns alignment is different because Crystal Reports uses a 1/4 inch tab width as opposed to a 1/2 inch tab width used by Microsoft Word and Microsof WordPad.
Resolution
- There is no options to change the tab width when using the RTF Text Interpretation in Crystal Reports.
- A workaround to have more consistant space between text when viewing the RTF code in Crystal Reports, versus when viewed in MS Word, will be to:
- Use spaces instead of tabs in the RTF code, and
- Format the database field with a fixed character width font such as Courier
- Note: If the columns do not align as desired when using spaces instead of tabs in your RTF code, modify the RTF code until it displays the desired alignment.
Keywords
RTF TEXT INTERPRETATION COLUMNS FORMAT FIELD TAB Crystal Reports RTF Text interpretation Format column , , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem
Product
Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016