I got the component RichView a short time and I'm having some difficulties to develop what I need. I am developing a software for civil registration, registration of birth, marriage and death, you know? The software is based on document templates.
Here are some questions:
1 - How do I save the document resulting from ScaleRichView directly into the database in RTF, without saving it on my computer before? And how do I view it later?
2 - I need to develop a software that has document templates with variables like "@NAME", "@GENDER", etc.. and then to register this information in the database, replace the variables in the text for information registered. Any ideas?
If you can answer these questions will be grateful.
Sorry for my english, I'm from Brazil and used the google translator.
William Antunes.
Document templates and variable substitution
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
1) You can use TDBSRichViewEdit.
Or, if you use TSRichViewEdit:
Or, if you use TSRichViewEdit:
Code: Select all
var Stream: TStream;
// saving
Table.Edit;
Stream := Table.CreateBlobStream(Table.FieldByName(FieldName), bmWrite);
SRichViewEdit1.RichViewEdit.SaveRTFToStream(Stream, False);
Stream.Free;
Table.Post;
// loading
Stream := Table.CreateBlobStream(Table.FieldByName(FieldName), bmRead);
SRichViewEdit1.RVHeader.Clear;
SRichViewEdit1.RVFooter.Clear;
SRichViewEdit1.RichViewEdit.Clear;
SRichViewEdit1.RichViewEdit.LoadRTFFromStream(Stream);
Stream.Free;
SRichViewEdit1.RVHeader.Format;
SRichViewEdit1.RVFooter.Format;
SRichViewEdit1.SetRVMargins;
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
2) As for variable substitution, see http://www.trichview.com/forums/viewtopic.php?t=8
Specifically:
http://www.trichview.com/support/files/ ... e-text.zip (values of fields (variables) are single-line text strings)
http://www.trichview.com/support/files/ ... -text3.zip (values of fields (variables) are multiline text strings)
(all other demos, without "text" in the zip's file name, require storing document in RVF, not RTF format)
Specifically:
http://www.trichview.com/support/files/ ... e-text.zip (values of fields (variables) are single-line text strings)
http://www.trichview.com/support/files/ ... -text3.zip (values of fields (variables) are multiline text strings)
(all other demos, without "text" in the zip's file name, require storing document in RVF, not RTF format)