How to replace text in with RVF-document.
Posted: Mon Jul 19, 2010 12:31 pm
Hello. I have the following problem.
I have RVF document loaded in TSRichViewEdit. The document contains special text tags like [FRAGMENT(1)]. Several RVF-documents are stored in database with TRichViewEdit.SaveRVFToStream.
I need to substitute tags with corresponding RVF-documents from DB. I tried something like this and it worked fine:
Pretty simple. But now we have more complex documents with tables etc (Our tags can bne placed in table cells). So I need to rewrite my code to work with TCustomRVData rather than with TSRichView. Any ideas how I can achieve this?
I have RVF document loaded in TSRichViewEdit. The document contains special text tags like [FRAGMENT(1)]. Several RVF-documents are stored in database with TRichViewEdit.SaveRVFToStream.
I need to substitute tags with corresponding RVF-documents from DB. I tried something like this and it worked fine:
Code: Select all
// rvOutput - TSRichViewEdit, containing main document
// stream - TStream, containing RVF-document, which we are going to insert
// i - index of current item, which we are going to replace
rvOutput.RichViewEdit.DeleteItems(i, 1);
rvOutput.RichViewEdit.InsertRVFFromStream(stream, i);
Code: Select all
// rvOutput - TCustomRVData, containing main document
// stream - TStream, containing RVF-document, which we are going to insert
// i - index of current item, which we are going to replace
... some code ...