I have a few questions relating to SR actionTestRibbonTab
I really like the look and feel and it has 99% of the functionality I want. I have added to it the ability to insert controls based on the InsertControls Demo It works.
1. I have no experience at the Ribbon. How do add a band and items ? Is there an step by step explanation ?
2. I wish to save my Doc to a Database table.
i. My field for the RVF is nVarChar(MAX) Is this OK ?
ii. Save and Load from DB table. Can you provide sample code of saving it to the DB and loading it back from the DB please. I tried for some hours to do it with streams but could not get it to work. I tried many different ways from various group postings but none of them work.
3. Id like to add compression. Is there anyway built into RVF to do compression or packed binary storage ?
Thanks very much,
Tony
Save and Lod from DB table and various other questions
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
1. I suggest to google "Delphi TRibbon tutorial"
2. No, Unicode-text field cannot store RVF. varbinary should be used.
Probably, your problems were because of incorrect field type.
The functions are below. But instead of them, you can simply use TDBSRichViewEdit.
3. TRichView itself does not provide methods for compression. You can use other compression tools. For example, you can pack using ZLib (included in Delphi), see the help file on TZCompressionStream and TZDecompressionStream.
2. No, Unicode-text field cannot store RVF. varbinary should be used.
Probably, your problems were because of incorrect field type.
The functions are below. But instead of them, you can simply use TDBSRichViewEdit.
Code: Select all
function SaveRVFToField(srv: TSRichViewEdit; tbl: TDataSet; const FieldName: String): Boolean;
var Stream: TStream;
begin
Stream := tbl.CreateBlobStream(tbl.FieldByName(FieldName), bmWrite);
try
Result := srv.RichViewEdit.SaveRVFToStream(Stream, False);
finally
Stream.Free;
end;
end;
function LoadRVFFromField(srv: TSRichViewEdit; tbl: TDataSet; const FieldName: String): Boolean;
var Stream: TStream;
begin
Stream := tbl.CreateBlobStream(tbl.FieldByName(FieldName), bmRead);
try
Result := srv.RichViewEdit.LoadRVFFromStream(Stream);
finally
Stream.Free;
end;
srv.Format;
end;
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: