Page 1 of 1

Create table

Posted: Fri Mar 25, 2011 2:39 pm
by Ceprotec
Hello Sergey.
Do you have any demo or some sample table creation and insertion of records in SRichViewEdit?

Posted: Fri Mar 25, 2011 3:43 pm
by Sergey Tkachenko
Inserting table (TRVTableItemInfo) in TSRichViewEdit, without RichViewActions?

The demo in Demos\RVDemos\Editors\Editor 1\, menu Table.

Posted: Mon Mar 28, 2011 2:53 pm
by Ceprotec
Sergey, how do I only line [0.0] stay with bold text?

Posted: Mon Mar 28, 2011 5:01 pm
by Sergey Tkachenko
Do you want to insert a new table with bold text in the first cell (or in the first row), and not bold in others?

Bold/not-bold is a property of text style, not table cell.
Each cell initially has one empty text string of the 0-th text style.
You can change it:

Code: Select all

table.Cells[0,0].Clear;
table.Cells[0,0].AddNL('', bold style index, 0);
Do you need an example how to insert a table where all cells have the current text style (but not bold) except for cells in the first tow, which have the current text style, but bold?

Posted: Mon Mar 28, 2011 7:13 pm
by Ceprotec
I do not need an example, thanks, I'm able to do, but the only doubt is that this bold style index is based on styles of RVStyle?

Posted: Tue Mar 29, 2011 6:56 am
by Sergey Tkachenko
Yes, text formatting is based only on text styles.

Posted: Wed Mar 30, 2011 12:00 pm
by Ceprotec
OK, thanks. How do the fields become established within the table centered?

Posted: Thu Mar 31, 2011 4:59 pm
by Sergey Tkachenko
Vertical centering in cell: Cell.VAlign.
Horizontal centering: Alignment of paragraph style.

Posted: Fri Apr 01, 2011 7:35 pm
by Ceprotec
Hello Sergey.

I'm not able to get the records (data) within the table (TTable) become centralized.

I use this command:

table: TRVTableItemInfo.CreateEx = (1.12 + QueryObi.RecordCount, SRichViewEdit1.RichViewEdit.RVData);
table.Color: = clNone;
table.BorderStyle: = rvtbColor;
table.CellBorderStyle: = rvtbColor;
table.BorderWidth: = 1;
table.BorderVSpacing: = 0;
table.BorderHSpacing: = 0;
table.CellBorderWidth: = 1;
table.CellPadding: = 0;
table.CellVSpacing: = 0;
table.CellHSpacing: = 0;
table.VRuleWidth: = 1;
table.HRuleWidth: = 1;


aux: = 'No. of Order';
size: = 70;
is r: = 0 to table.Rows.Count-1
is c: = 0 to table.Rows [r]. Count-1 do begin
if (r> 0) and (c = 0) then
begin
aux: = FormatFloat ('0000000 ', StrToInt (QueryObiTermo.AsString));
size: = 70;
end;

table.Cells [r, c]. BestWidth: = size;
table.Cells [r, c]. Clear;
if r = 0 then Style: = 22
else Style: = 23;
table.Cells [r, c]. AddFmt (aux, [], style, 0);
table.Cells [r, c]. Color: = clWhite;

SRichViewEdit1.RichViewEdit.InsertItem if ('', table) then
begin

end;


What command I use to centralize data into the table?

Posted: Sat Apr 02, 2011 7:19 am
by Sergey Tkachenko
When calling AddFmt, specify the index of paragraph having Alignment=rvaCenter, as the last parameter.
It is the index in RVStyle.ParaStyles collection.