Is there a Crystal Reports formula that takes out RTF formatting embedded in a field

I have a field that has RTF embedded inside of the field all around the text I need. Does Crystal Reports have a tool that removes that formatting by chance? The word "Test" in front of "\par" is what I need to get out of the field. Each field is a bit different.

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17 Test\par
}

Another example below we need the record the words "I wish I was in the land of cotton."

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17 I wish I was in the land of cotton.\par
}
I just wondered if Crystal had such a tool that recognized RTF and could remove it and just show text?
Fletcher BurdineTableau Trainer & Consultant Sales Exec.Asked:
Who is Participating?
 
RDWaibelCommented:
I hate to ask this BUT...
Right click the Details field...
Format Field -> Paragraph tab -> Text Interpretation -> RTF text.
0
 
RDWaibelCommented:
Couple of questions here:
1)  Version of Crystal Reports
2)  What is producing the report?
3)  Do you have the latest patches for Crystal Reports

As I understand it, CR can read and display rtf tags (From SAP Support Site)
In CR, a list of supported RTF tags does not exist.

List of RTF tags Known to Format Correctly in CR
------------------------------------------------
\fonttbl · font table generation
\colortbl · color table generation
\tab · fixed tabs (fixed meaning set on a horizontal line position)
\par · new paragraph...essentially a carriage return or line feed
\qr · paragraph alignment (qr is right aligned, qc is centered, ql is left aligned)
\ul · underline (ulnone is used to switch off underline)
\b · bold (b0 is used to switch off bold)
\fi2880 · indent first line of paragraph (in this example the indent is 2 inches)
\li1440 · left indent all (in this example the indent is 1 inch)
\strike · strikeout font
\emdash or \endash · both produce the smaller "-" dash (en-dash, a dash the width of the letter "n")
\emspace or \enspace · both produce the smaller " " space (en-space, a space the width of the letter "n")
\ldblquote · left double quotation mark (rdblquote produces a right double quotation mark)
\lquote · left single quotation mark (rquote produces a right single quotation mark)
\bullet · bullet mark

List of RTF tags Known to Not Format Correctly in CR
----------------------------------------------------
\pntext\f1\'B7 · bulleted indents (in this example a round bullet is used)
\sub · subscript
\super · superscript
\trowd · tables and any table, row, or cell-related tags
\shad · shadows
\animtext · animated text
\caps · apply capital letters
\uldb · double underline
\uldash · dash underline
\ulth · thick underline
\ulw · wave underline
\chshdng · character shading
\chdate · current date
\bkmrkstart or \bkmarkend · bookmark start or bookmark end
\pict, \wbitmap, etc. · pictures and any picture-related tags
\object · OLE objects and any OLE object-related tags
\do · Drawing objects and any Drawing object-related tags

This might also get you some information, open CR, Press good ole F1, enter 'Text Interpretation'.
0
 
oliffCommented:
If the field always includes the same RTF, just replace it with nothing?
local stringvar rtftext;

rtftext := "{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17 I wish I was in the land of cotton.\par
}";

rtftext:=replace(rtftext,"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17 ","");

rtftext:=replace(rtftext,"\par
}","");

rtftext;

Open in new window

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Fletcher BurdineTableau Trainer & Consultant Sales Exec.Author Commented:
1)  Version of Crystal Reports  latest version of 2008
2)  What is producing the report? When you say producing do you mean the application? It comes out of an ACT database. It has an OLE DB driver that pulls the data out.
3)  Do you have the latest patches for Crystal Reports Yes we have the latest patches.
See the image below. There is a little more to the records than that. They are not always consistent. How do we drop the RTF formatting embedded in the field.I do not know if this helps.

HistoryDetailsField.png
0
 
oliffCommented:
RDWaibel, i thought that, but his original query made it sound more like he wanted to check off of the data contained? Now I look at his report, Text Interpretation looks right.
0
 
mlmccCommented:
There is no function in Crystal to remove the RTF formatting from a text field.  

As suggested above you can set it to RTF interpretation or write your own RTF parser to remove the RTF commands and leave the text.

What do you want the output to be on the report?

mlmcc
0
 
Fletcher BurdineTableau Trainer & Consultant Sales Exec.Author Commented:
I had forgotten that one was in there. That was a training question 3 years ago. I remember it now. I wondered if you could but I thought it was a formula function and could not find it thank you all very much.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.