Hey,
I have used TRichView->LoadRTF(with path to RTF).
Now I want to use TDBRichView and to get path that stored as string in TClientDataSet .
DataField in TDBRichView throws error if I set string field.
What can I do?
What type is DataField in TDBRichView?
Thanks
P.S. I need it to be autoedit.
RTF via TDBRichView
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I do not understand the question completely, but as for data type for TDBRichView/TDBRichViewEdit, it must be able to contain data of any size.
(Table.FieldByName(...) is TBLOBField) must be True for this field.
If field contains RTF document, it may be a memo field.
But by default, TDBRichViewEdit stores documents in RVF, not RTF (you can change this by modifying FieldFormat property). For RVF documents, the field must be able to store arbitrary binary data.
(Table.FieldByName(...) is TBLOBField) must be True for this field.
If field contains RTF document, it may be a memo field.
But by default, TDBRichViewEdit stores documents in RVF, not RTF (you can change this by modifying FieldFormat property). For RVF documents, the field must be able to store arbitrary binary data.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
No, TDBRichView assumes that it is linked to TBlobField.
After conversion to memo, you can use LoadCustomFormat event to display RTF files linked from this field:
After conversion to memo, you can use LoadCustomFormat event to display RTF files linked from this field:
Code: Select all
procedure TForm1.DBRichView1LoadCustomFormat(Sender: TCustomRichView;
Stream: TStream; var DoDefault: Boolean);
var s: String;
begin
Stream.Position := 0;
SetLength(s, Stream.Size);
Stream.ReadBuffer(PChar(s)^, Length(s));
Sender.LoadRTF(s);
DoDefault := False;
end;
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: