Loading files together
Loading files together
Hello Sergey.
I'm having the following problem: how do I open files saved SrichView bringing two separate? I say, I saved in the database with SQL Server binary format, and with property SaveRVFToStream. For example I record two separate models, and would like to these two models together, one below the other, on separate sheets within the same SrichView. How do I do that?
Thanks.
I'm having the following problem: how do I open files saved SrichView bringing two separate? I say, I saved in the database with SQL Server binary format, and with property SaveRVFToStream. For example I record two separate models, and would like to these two models together, one below the other, on separate sheets within the same SrichView. How do I do that?
Thanks.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
See http://www.trichview.com/forums/viewtopic.php?t=272
Use SRichViewEdit1.RichViewEdit as rv parameter.
Use SRichViewEdit1.RichViewEdit as rv parameter.
I used:
AddDoc procedure (const FileName: String; rv: TCustomRichView);
var Stream: TFileStream;
ItemCount: Integer;
begin
ItemCount: = rv.ItemCount;
Stream: = TFileStream.Create (FileName, fmOpenRead);
rv.InsertRVFFromStream (Stream, rv.ItemCount);
Stream.Free;
if (ItemCount> 0) and (ItemCount <rv.ItemCount) then
rv.PageBreaksBeforeItems [ItemCount]: = True;
end;
But he's TCustomRichView error? As stated?
AddDoc procedure (const FileName: String; rv: TCustomRichView);
var Stream: TFileStream;
ItemCount: Integer;
begin
ItemCount: = rv.ItemCount;
Stream: = TFileStream.Create (FileName, fmOpenRead);
rv.InsertRVFFromStream (Stream, rv.ItemCount);
Stream.Free;
if (ItemCount> 0) and (ItemCount <rv.ItemCount) then
rv.PageBreaksBeforeItems [ItemCount]: = True;
end;
But he's TCustomRichView error? As stated?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yes it opens the files if they are saved in C: /.
But I have the files saved in the database SQL SERVER 2000. Normally I use the following code to load:
Stream: = Table1.CreateBlobStream (Table1MODELO, bmRead);
SRichViewEdit1.RVHeader.Clear;
SRichViewEdit1.RVFooter.Clear;
SRichViewEdit1.RichViewEdit.Clear;
SRichViewEdit1.RichViewEdit.LoadRVFFromStream (Stream);
Stream.Free;
SRichViewEdit1.RVHeader.Format;
SRichViewEdit1.RVFooter.Format;
SRichViewEdit1.SetRVMargins;
how I would combine the two functions: to charge and to unite them?
But I have the files saved in the database SQL SERVER 2000. Normally I use the following code to load:
Stream: = Table1.CreateBlobStream (Table1MODELO, bmRead);
SRichViewEdit1.RVHeader.Clear;
SRichViewEdit1.RVFooter.Clear;
SRichViewEdit1.RichViewEdit.Clear;
SRichViewEdit1.RichViewEdit.LoadRVFFromStream (Stream);
Stream.Free;
SRichViewEdit1.RVHeader.Format;
SRichViewEdit1.RVFooter.Format;
SRichViewEdit1.SetRVMargins;
how I would combine the two functions: to charge and to unite them?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Instead of creating/destroying TFileStream for a file, use this stream.
Code: Select all
procedure AddDoc(Stream: TStream; rv: TCustomRichView);
var ItemCount: Integer;
begin
ItemCount := rv.ItemCount;
Stream.Position := 0;
rv.InsertRVFFromStream(Stream, rv.ItemCount);
if (ItemCount>0) and (ItemCount<rv.ItemCount) then
rv.PageBreaksBeforeItems[ItemCount] := True;
end;
SRichViewEdit1.Clear;
Stream: = Table1.CreateBlobStream (Field1, bmRead);
AddDoc(Stream, SRichViewEdit1.RichViewEdit);
Stream.Free;
Stream: = Table1.CreateBlobStream (Field2, bmRead);
AddDoc(Stream, SRichViewEdit1.RichViewEdit);
Stream.Free;
SRichViewEdit1.Format;
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: