Copy hole table

General TRichView support forum. Please post your questions here
Post Reply
Guest

Copy hole table

Post by Guest »

How can I select and copy the hole table in my document?
I use 1 document as template. And the document is filled by the source code with data from a dataset.
For each record I want copy a table which is defined already in the template document.
How can I select the total table and copy it to a position in another table.

{somethin like:
for lCnt:=0 to aDataset.RecordCount do
begin
SelectTable();
CopyTable();
FillTableByRecord();
end;}
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you want to copy cells of one table in cells of another table?
Guest

Post by Guest »

I want to copy the table totally.

I have 1 main table. In each row I want to copy the table which is in the template document in the main table in cell [0,0]
The table in cell 0,0 I want to copy to cell[1,0] of the same maintable
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Code: Select all

Stream := TMemoryStream.Create;
sourcetable.SaveToStream(Stream);
desttable := TRVTableItemInfo.CreateEx(1,1, rv.RVData);
Stream.Position := 0;
desttable.LoadFromStream(Stream);
Stream.Free;
<insert desttable where you want)
Post Reply