Problems with RTF format on Windows 98
Hello, I use TfrRichView in m reports and on Win XP it works fine, but on Win 98. The richtext appears as plain with rtf tags. For exampe:
{\rtf1\ansi\ansicpg1251\deff0\deflang3098{\fonttbl{\f0\fswiss\fprq2\fcharset204 Verdana;}{\f1\fswiss\fcharset204{\*\fname Verdana;}Verdana ;}}{\colortbl ;\red0\green0\blue255;}\viewkind4\uc1\pard\lang1026\f0\qj\fs16\par Според \b \ul ВаÑил Иванов\ulnone \b0 -\b \ul Лучано\ulnone \b0 Ñ‚Ñ€Ñбва да Ñе изчака краÑÑ‚ на разÑледването на КомиÑиÑта по етика към МОК и тогава да Ñе дават оценки по ÐºÐ¾Ñ€ÑƒÐ¿Ñ†Ð¸Ð¾Ð½Ð½Ð¸Ñ Ñкандал.\lang1026\f1}
istead of:
Според ВаÑил Иванов-Лучано Ñ‚Ñ€Ñбва да Ñе изчака краÑÑ‚ на разÑледването на КомиÑиÑта по етика към МОК и тогава да Ñе дават оценки по ÐºÐ¾Ñ€ÑƒÐ¿Ñ†Ð¸Ð¾Ð½Ð½Ð¸Ñ Ñкандал
I want to ask if that is a known problem and is there a way to fix it.
{\rtf1\ansi\ansicpg1251\deff0\deflang3098{\fonttbl{\f0\fswiss\fprq2\fcharset204 Verdana;}{\f1\fswiss\fcharset204{\*\fname Verdana;}Verdana ;}}{\colortbl ;\red0\green0\blue255;}\viewkind4\uc1\pard\lang1026\f0\qj\fs16\par Според \b \ul ВаÑил Иванов\ulnone \b0 -\b \ul Лучано\ulnone \b0 Ñ‚Ñ€Ñбва да Ñе изчака краÑÑ‚ на разÑледването на КомиÑиÑта по етика към МОК и тогава да Ñе дават оценки по ÐºÐ¾Ñ€ÑƒÐ¿Ñ†Ð¸Ð¾Ð½Ð½Ð¸Ñ Ñкандал.\lang1026\f1}
istead of:
Според ВаÑил Иванов-Лучано Ñ‚Ñ€Ñбва да Ñе изчака краÑÑ‚ на разÑледването на КомиÑиÑта по етика към МОК и тогава да Ñе дават оценки по ÐºÐ¾Ñ€ÑƒÐ¿Ñ†Ð¸Ð¾Ð½Ð½Ð¸Ñ Ñкандал
I want to ask if that is a known problem and is there a way to fix it.
Comments
the only time i have seen this is if for some reason the text only property of the memo is set to true.
I use my own algorithm to insert rtf tags I need. After that I set the richedit.text property to the prepared text:
rtfString := GetRichEditString(string);
view := frReport.FindObject('MemoAddInfo');
TfrRichView(view).RichEdit.Text := rtfString;
In GetRichEditString(aString) I do the following
begin
Result := RTF_START + Format(RTF_FONTSIZE_TAG,[aFontSize]) + aString + RTF_END;
end;
//where using theese constants
const RTF_START: String = '{\rtf1\ansi\ansicpg1251\deff0\deflang3098'+
'{\fonttbl{\f0\fswiss\fprq2\fcharset204 Verdana;}'+
'{\f1\fswiss\fcharset204{\*\fname Verdana;}Verdana ;}}'+
'{\colortbl ;\red0\green0\blue255;}'+
'\viewkind4\uc1\pard\lang1026\f0\qj';
RTF_END: String = '\lang1026\f1} ';
RTF_FONTSIZE_TAG: String = '\fs%d ';
And on Win XP this works, but on Win 98 it doesn't.
I had this problem too.
To solve it you must use TfrRxRichView instead of TfrRichView
To use (and have) this component you must unistall fast report, install rx lib ver >=2.60 (freeware can be found very easy), then goto fast report source, fr.inc and un-comment the {$DEFINE RX} line (rx rich edit 2)
Recompile and install fastreport again and it works...
Hope it helps...
You realy saved my life.
Best Wishes,
Alex
The problem is the difference between delphis richedit upon which fr's richedit is based. it does not recognize the version differences in MS richedit dll versions
where rx does.
Alex if you are using d7 the updated rxlib is in the jvc stuff on the companion cd
there is upgraded rxlib which can be used without having to install jvc and making any jvc changes.