Page 1 of 1

Table adding rows at runtime in RichView

Posted: Wed May 21, 2008 8:26 am
by BernhardRoos
Hello,
I want solve following. In RichViewEdit the user has only insert a table with one row and placeholders in cells.
Now at runtime I want to add so many rows as recordcount in a db table.
Is there a example to do this?
I have tried to do following :

table := TRVTableItemInfo(RVData.GetItem(i));

For u := 0 to (tTabelle.RecordCount-1) do begin
table.Rows.Add(table.Rows[0].Count);
...
end;

But if I print it I get the error : Index out of bounds (but the table rows are printing). What do I wrong?

Best wishes
Bernhard

Posted: Wed May 21, 2008 11:02 am
by BernhardRoos
Another question.

Is it possible in a TRichView at runtime a table cell from one table to clone (all items) in another cell from another table?

Best wishes
Bernhard

Posted: Thu May 22, 2008 9:40 am
by Sergey Tkachenko
1.

Code: Select all

table.InsertRows(table.RowCount, Count, table.RowCount-1);
RichView1.Format;
2. Do you want copy cell to cell or row(s) to row(s)? Do the source and the target are in the same table? or different tables in the same RichView? or in different RichViews?