Displaying unicode text in Rave Reports on Delphi 2009

青春壹個敷衍的年華 提交于 2019-12-09 21:29:53

问题


I am in the process of porting a Delphi 2006 app to Delphi 2009. Out of the box support for unicode has been easy - almost no work required. Most 3rd party controls already have Delphi 2009 updates available.

Rave Reports (latest version 7.6.1, available here) has also been updated, but I cannot seem to get it to correctly display RTF text containing Japanese characters. In Delphi 2006, I loaded RTF to the DataMemo component in a RVCustomConnection's OnGetRow event by reading the RTF from a screen control (TLMDRichEdit) using streams and then doing a CustomConnection.WriteBlobData.

In the report output, any RTF text now shows up as a series of rectanges and % signs. No readable text. All other text (displayed using Text and DataText components) displays correctly.

Does anyone have any experience on how to get RTF containing unicode to display correctly? Is it even supported?


回答1:


I used this...it seemed to work with Dephi XE's built in RAVE package...

Procedure TfrmMain.RaveCustomConnectionGetRow                  (         Connection: TRvCustomConnection);
Var
  MemoString : String;
  Index      : Integer;
  Size       : Integer;
  Buffer     : PAnsiChar;

Begin


  { Init MemoString }
  MemoString := '';

  For Index := 0 To DataList.Count - 1 Do Begin
    MemoString := MemoString + DataList.Strings [Index] + #13#10;
  End; { For }

  { Set the Size (Unicode) and Buffer }
  Size := Length (MemoString) * 2;
  Buffer := PAnsiChar (MemoString);

  { Send the data over as a Blob object to RAVE }
  Connection.WriteBlobData (Buffer^, Size);

End; { RaveCustomConnectionGetRow Procedure }



回答2:


Unless someone from Nevrona cares to comment, I am concluding that it is not (yet) possible.




回答3:


Even without unicode the RTF printing in Rave reports is broken (adds rectangles at the end of the lines). New version 7.6.2 has not fixed this,,,

F&^%ing pathetic from Codegear (or what is it called now) and Nevrona...



来源:https://stackoverflow.com/questions/527287/displaying-unicode-text-in-rave-reports-on-delphi-2009

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!