February 16, 2006 at 11:44 pm
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}}
\viewkind4\uc1\pard\b\fs23 This Customer is with our company sice 2000.
\par Continue with it.
\par}
-------------------------------------------------------------------------
Whole text given above is stored in my table as a text field.
i want to display colored text only in report preview.
Can any1 help ?
February 18, 2006 at 4:50 am
Other than trying to write your own RegEx parsing strings, I'd try to use someone else's RTF to TXT conversion code. Here are a few ways -> http://www.freedownloadscenter.com/Web_Authoring/HTML_to_ASCII_Converters/RTF_to_HTML_DLL.html ; http://daringfireball.net/2003/04/rtf_to_plain_text_translator
This one points to using regex to do the work (seems like a LOT of work to me) -> http://groups.google.com/group/php.general/browse_thread/thread/d8b39b625b55660d/65f5e1f1b0c4e28c%2365f5e1f1b0c4e28c?sa=X&oi=groupsr&start=0&num=3
This one seems to have a reasonable RTF to HTML conversion done in VB.net, could be usable if you convert to html then convert to text -> http://forums.asp.net/1134342/ShowPost.aspx
Good luck!
Steve.
February 20, 2006 at 4:07 am
Hi,
Difficult problem. We had the same issue. The code is not HTML but RTF. Solution:
1. use this component:
REGEX (http://www.codeproject.com/managedcpp/xpregex.asp) and use this syntax to get rid of RTF:
SELECT
master.dbo.fn_regex_replace(CAST(CAST(Field AS binary(8000)) AS varchar(8000)) ,'({\\)(.+?)(})|(\\)(.+?)(\b)|}|', '')
FROM yourTable
(our fields were binary)
or just:
SELECT
master.dbo.fn_regex_replace(Field ,'({\\)(.+?)(})|(\\)(.+?)(\b)|}|', '')
FROM yourTable
(if your field is already of type varchar.)
2. Use another report tool thata handles RTF data
3. Write a custom tool that handles RTF data. (There is a RTFEdit box in MS dev. tools).
JP
February 21, 2006 at 1:27 am
Is there any other solution ?
Coz this is not working !
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply