Read RTF from Database Blobfield

I store RTF files in MSSQL using code below to read back into a RTF editor in VCL. I want to use the stored RTF as content for a FastReport, can't seem to work this one out....

var

DocStream : TStream;

 content: TBlobField;

begin

 // Get the field that contains the document content

 content := TBlobField(qryDoc.FieldByName('Content'));

 // Create the document content stream

 DocStream := qryDoc.CreateBlobStream(content,bmRead);

 try

  // Load the contents of the Editor window from the stream

  DocEditor.LoadDocument(DocStream,TdxRichEditDocumentFormat.OpenXml);

 finally

  // Tidy up

  DocStream.Free;

 end;

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.