Page 1 of 1

Copy hole table

Posted: Mon Nov 21, 2005 3:56 pm
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;}

Posted: Mon Nov 21, 2005 8:35 pm
by Sergey Tkachenko
Do you want to copy cells of one table in cells of another table?

Posted: Tue Nov 22, 2005 8:10 am
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

Posted: Tue Nov 22, 2005 3:20 pm
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)