Add text with different formats in a cell
-
- Posts: 20
- Joined: Fri Jun 03, 2011 8:33 pm
Add text with different formats in a cell
Hello!
I would like to know if there is possible to add the follow line into a cell:
Bold Italic
Explanation: I need to write a text with two different styles of formatation in the same line, inside a table cell.
How can I do that?
Thanks.
I would like to know if there is possible to add the follow line into a cell:
Bold Italic
Explanation: I need to write a text with two different styles of formatation in the same line, inside a table cell.
How can I do that?
Thanks.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 20
- Joined: Fri Jun 03, 2011 8:33 pm
Hello Sergey, thanks for help.
I'm trying to use the edit method to modify the content of a table cell.
Using some of examples, I did what I want to.
In my project, I'm using this code:
Ok, it works fine, the table is created, but when I move the mouse over the table border, I get an error: List index out of bounds (-60)
This error showns up only on table border, not happens in cell borders.
Why is this happening?[/b]
I'm trying to use the edit method to modify the content of a table cell.
Using some of examples, I did what I want to.
In my project, I'm using this code:
Code: Select all
TABLEECOCAR := TRVTableItemInfo.CreateEx(5,6,TLRESULTADOS.DBSRichViewEdit1.RichViewEdit.RVData);
TABLEECOCAR.BorderWidth := 0;
TABLEECOCAR.CellBorderWidth := 0;
FOR L := 0 TO TABLEECOCAR.RowCount-1 DO
BEGIN
FOR C:= 0 TO TABLEECOCAR.ColCount-1 DO
BEGIN
TABLEECOCAR.Cells[L,C].Clear;
TABLEECOCAR.Cells[L,C].Color:=$00DFDFDF;
TABLEECOCAR.Cells[L,C].VAlign:=rvcMiddle;
END;
END;
{TABLEECOCAR.MergeCells(0,0,6,1,TRUE);
TABLEECOCAR.MergeCells(1,0,6,1,TRUE);
TABLEECOCAR.MergeCells(2,0,2,1,TRUE);
TABLEECOCAR.MergeCells(2,3,2,1,TRUE);
TABLEECOCAR.MergeCells(2,5,2,1,TRUE);
TABLEECOCAR.MergeCells(6,3,3,1,TRUE);
TABLEECOCAR.Cells[0,0].AddNL('Mensuração',6,0);}
{if (wpeso.Value <> 0) or (WALTURA.Value<>0) then
begin
TABLEECOCAR.Cells[1,0].AddNL('Peso: '+ WPESO.Text +' Kgs.'+
' Altura: '+WALTURA.Text+ 'm.' ,0,0);
end;}
TABLEECOCAR.Cells[0,0].AddNL('Mensuração',6,0);
TABLEECOCAR.Cells[0,2].AddNL('Valores ref.',6,1);
TABLEECOCAR.Cells[0,5].AddNL('Valores ref.',6,1);
if (WATRIAOR.Value <> 0) then
begin
TABLEECOCAR.Cells[1,0].AddNL('Aorta',6,0);
TABLEECOCAR.Cells[1,1].AddNL(WATRIAOR.Text+'mm',0,1);
end;
if (WATRIESQ.Value<>0)then
begin
TABLEECOCAR.Cells[2,0].AddNL('Átrio esquerdo',6,0);
TABLEECOCAR.Cells[2,1].AddNL(WATRIESQ.Text +'mm' ,0,1);
end;
if (WVENTDIR.Value<>0)then
begin
TABLEECOCAR.Cells[3,0].AddNL('V.D.',6,0);
TABLEECOCAR.Cells[3,1].AddNL(WVENTDIR.Text +'mm',0,1);
end;
if (WVENTESQDI.Value <> 0 ) then
begin
TABLEECOCAR.Cells[4,0].AddNL('V.E.(Diástole)',6,0);
TABLEECOCAR.Cells[4,1].AddNL(WVENTESQDI.Text +'mm' ,0,1);
end;
if (WATRIAOR.Value <> 0) then
begin
TABLEECOCAR.Cells[1,2].AddNL(REFAO.Caption,6,1);
end;
if (WATRIESQ.Value<>0)then
begin
TABLEECOCAR.Cells[2,2].AddNL(REFAE.Caption,6,1);
end;
if (WVENTDIR.Value<>0)then
begin
TABLEECOCAR.Cells[3,2].AddNL(REFVD.Caption,6,1);
end;
if (WVENTESQDI.Value <> 0 ) then
begin
TABLEECOCAR.Cells[4,2].AddNL(REFVED.Caption,6,1);
end;
if (WVENTESQSI.Value <> 0 ) then
begin
TABLEECOCAR.Cells[1,3].AddNL('V.E.(Sístole)',6,0);
TABLEECOCAR.Cells[1,4].AddNL(WVENTESQSI.Text +'mm',0,1);
end;
if WSEPTO.Value <> 0 then
begin
TABLEECOCAR.Cells[2,3].AddNL('Septo',6,0);
TABLEECOCAR.Cells[2,4].AddNL(WSEPTO.Text +'mm' ,0,1);
end;
if (WPPVENTESQ.Value <> 0) then
begin
TABLEECOCAR.Cells[3,3].AddNL('Par. post. V.E.',6,0);
TABLEECOCAR.Cells[3,4].AddNL(WPPVENTESQ.Text +'mm' ,0,1);
end;
if WSEPTO.Value <> 0 then
begin
TABLEECOCAR.Cells[2,5].AddNL(REFSEPTO.Caption,6,1);
end;
if (WPPVENTESQ.Value <> 0) then
begin
TABLEECOCAR.Cells[3,5].AddNL(REFPPVE.Caption,6,1);
end;
TABLEECOCAR.BestWidth := -90;
DBSRichViewEdit1.RichViewEdit.InsertItem('',TABLEECOCAR);
DBSRichViewEdit1.RichViewEdit.InsertBreak(0,rvbsLine,clWindowText);
This error showns up only on table border, not happens in cell borders.
Why is this happening?[/b]
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 20
- Joined: Fri Jun 03, 2011 8:33 pm
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 20
- Joined: Fri Jun 03, 2011 8:33 pm
I don't know if this can help, but I use the same code on same button to create another 2 tables, and this error does not happens with that tables, just the first one.
The code used to create the first table is a copy of the second table, just like the same.
Other things that can help to discover the error:
- RVStyle is on FPrincipal form;
- DBSRichView is on TLRESULTADOS form;
- Code that creates the table on DBSRichView is on TLUSECOCAR form;
Any suggestion?
Need more details?
The code used to create the first table is a copy of the second table, just like the same.
Other things that can help to discover the error:
- RVStyle is on FPrincipal form;
- DBSRichView is on TLRESULTADOS form;
- Code that creates the table on DBSRichView is on TLUSECOCAR form;
Any suggestion?
Need more details?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 20
- Joined: Fri Jun 03, 2011 8:33 pm
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 20
- Joined: Fri Jun 03, 2011 8:33 pm
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 20
- Joined: Fri Jun 03, 2011 8:33 pm
First table:
Second table:
Sergey, is that a good idea to access my computer using Teamviwer (remote access)?
You can see by yourself the error.
Code: Select all
TBAUX := TRVTableItemInfo.CreateEx(5,6,TLRESULTADOS.DBSRichViewEdit1.RichViewEdit.RVData);
//TBAUX.BorderColor := $00A98E10;
//TBAUX.CellBorderColor := $00A98E10;
TBAUX.BorderWidth := 0;
TBAUX.CellBorderWidth := 0;
{TBAUX.Cells[2,2].BestWidth := 130;
TBAUX.Cells[2,5].BestWidth := 130;
TBAUX.Cells[3,0].BestWidth := 90;
TBAUX.Cells[3,1].BestWidth := 70;
TBAUX.Cells[3,3].BestWidth := 150;
TBAUX.Cells[3,4].BestWidth := 70;
TBAUX.Cells[3,5].BestWidth := 130;}
FOR L := 0 TO TBAUX.RowCount-1 DO
BEGIN
FOR C:= 0 TO TBAUX.ColCount-1 DO
BEGIN
TBAUX.Cells[L,C].Clear;
TBAUX.Cells[L,C].Color:=$00DFDFDF;
TBAUX.Cells[L,C].VAlign:=rvcMiddle;
END;
END;
{TBAUX.MergeCells(0,0,6,1,TRUE);
TBAUX.MergeCells(1,0,6,1,TRUE);
TBAUX.MergeCells(2,0,2,1,TRUE);
TBAUX.MergeCells(2,3,2,1,TRUE);
TBAUX.MergeCells(2,5,2,1,TRUE);
TBAUX.MergeCells(6,3,3,1,TRUE);
TBAUX.Cells[0,0].AddNL('Mensuração',6,0);}
{if (wpeso.Value <> 0) or (WALTURA.Value<>0) then
begin
TBAUX.Cells[1,0].AddNL('Peso: '+ WPESO.Text +' Kgs.'+
' Altura: '+WALTURA.Text+ 'm.' ,0,0);
end;}
TBAUX.Cells[0,0].AddNL('Mensuração',6,0);
TBAUX.Cells[0,2].AddNL('Valores ref.',6,1);
TBAUX.Cells[0,5].AddNL('Valores ref.',6,1);
if (WATRIAOR.Value <> 0) then
begin
TBAUX.Cells[1,0].AddNL('Aorta',6,0);
TBAUX.Cells[1,1].AddNL(WATRIAOR.Text+'mm',0,1);
end;
if (WATRIESQ.Value<>0)then
begin
TBAUX.Cells[2,0].AddNL('Átrio esquerdo',6,0);
TBAUX.Cells[2,1].AddNL(WATRIESQ.Text +'mm' ,0,1);
end;
if (WVENTDIR.Value<>0)then
begin
TBAUX.Cells[3,0].AddNL('V.D.',6,0);
TBAUX.Cells[3,1].AddNL(WVENTDIR.Text +'mm',0,1);
end;
if (WVENTESQDI.Value <> 0 ) then
begin
TBAUX.Cells[4,0].AddNL('V.E.(Diástole)',6,0);
TBAUX.Cells[4,1].AddNL(WVENTESQDI.Text +'mm' ,0,1);
end;
if (WATRIAOR.Value <> 0) then
begin
TBAUX.Cells[1,2].AddNL(REFAO.Caption,6,1);
end;
if (WATRIESQ.Value<>0)then
begin
TBAUX.Cells[2,2].AddNL(REFAE.Caption,6,1);
end;
if (WVENTDIR.Value<>0)then
begin
TBAUX.Cells[3,2].AddNL(REFVD.Caption,6,1);
end;
if (WVENTESQDI.Value <> 0 ) then
begin
TBAUX.Cells[4,2].AddNL(REFVED.Caption,6,1);
end;
if (WVENTESQSI.Value <> 0 ) then
begin
TBAUX.Cells[1,3].AddNL('V.E.(Sístole)',6,0);
TBAUX.Cells[1,4].AddNL(WVENTESQSI.Text +'mm',0,1);
end;
if WSEPTO.Value <> 0 then
begin
TBAUX.Cells[2,3].AddNL('Septo',6,0);
TBAUX.Cells[2,4].AddNL(WSEPTO.Text +'mm' ,0,1);
end;
if (WPPVENTESQ.Value <> 0) then
begin
TBAUX.Cells[3,3].AddNL('Par. post. V.E.',6,0);
TBAUX.Cells[3,4].AddNL(WPPVENTESQ.Text +'mm' ,0,1);
end;
if WSEPTO.Value <> 0 then
begin
TBAUX.Cells[2,5].AddNL(REFSEPTO.Caption,6,1);
end;
if (WPPVENTESQ.Value <> 0) then
begin
TBAUX.Cells[3,5].AddNL(REFPPVE.Caption,6,1);
end;
TBAUX.BestWidth := -90;
DBSRichViewEdit1.RichViewEdit.InsertItem('',TBAUX);
DBSRichViewEdit1.RichViewEdit.InsertBreak(0,rvbsLine,clWindowText);
Code: Select all
TABLEECOCAR := TRVTableItemInfo.CreateEx(5,6,TLRESULTADOS.DBSRichViewEdit1.RichViewEdit.RVData);
//TABLEECOCAR.BorderColor := $00A98E10;
//TABLEECOCAR.CellBorderColor := $00A98E10;
TABLEECOCAR.BorderWidth := 0;
TABLEECOCAR.CellBorderWidth := 0;
{TABLEECOCAR.Cells[2,2].BestWidth := 130;
TABLEECOCAR.Cells[2,5].BestWidth := 130;
TABLEECOCAR.Cells[3,0].BestWidth := 90;
TABLEECOCAR.Cells[3,1].BestWidth := 70;
TABLEECOCAR.Cells[3,3].BestWidth := 150;
TABLEECOCAR.Cells[3,4].BestWidth := 70;
TABLEECOCAR.Cells[3,5].BestWidth := 130;}
FOR L := 0 TO TABLEECOCAR.RowCount-1 DO
BEGIN
FOR C:= 0 TO TABLEECOCAR.ColCount-1 DO
BEGIN
TABLEECOCAR.Cells[L,C].Clear;
TABLEECOCAR.Cells[L,C].Color:=$00DFDFDF;
TABLEECOCAR.Cells[L,C].VAlign:=rvcMiddle;
END;
END;
{TABLEECOCAR.MergeCells(0,0,6,1,TRUE);
TABLEECOCAR.MergeCells(1,0,6,1,TRUE);
TABLEECOCAR.MergeCells(2,0,2,1,TRUE);
TABLEECOCAR.MergeCells(2,3,2,1,TRUE);
TABLEECOCAR.MergeCells(2,5,2,1,TRUE);
TABLEECOCAR.MergeCells(6,3,3,1,TRUE);
TABLEECOCAR.Cells[0,0].AddNL('Mensuração',6,0);}
{if (wpeso.Value <> 0) or (WALTURA.Value<>0) then
begin
TABLEECOCAR.Cells[1,0].AddNL('Peso: '+ WPESO.Text +' Kgs.'+
' Altura: '+WALTURA.Text+ 'm.' ,0,0);
end;}
TABLEECOCAR.Cells[0,0].AddNL('Mensuração',6,0);
TABLEECOCAR.Cells[0,2].AddNL('Valores ref.',6,1);
TABLEECOCAR.Cells[0,5].AddNL('Valores ref.',6,1);
if (WATRIAOR.Value <> 0) then
begin
TABLEECOCAR.Cells[1,0].AddNL('Aorta',6,0);
TABLEECOCAR.Cells[1,1].AddNL(WATRIAOR.Text+'mm',0,1);
end;
if (WATRIESQ.Value<>0)then
begin
TABLEECOCAR.Cells[2,0].AddNL('Átrio esquerdo',6,0);
TABLEECOCAR.Cells[2,1].AddNL(WATRIESQ.Text +'mm' ,0,1);
end;
if (WVENTDIR.Value<>0)then
begin
TABLEECOCAR.Cells[3,0].AddNL('V.D.',6,0);
TABLEECOCAR.Cells[3,1].AddNL(WVENTDIR.Text +'mm',0,1);
end;
if (WVENTESQDI.Value <> 0 ) then
begin
TABLEECOCAR.Cells[4,0].AddNL('V.E.(Diástole)',6,0);
TABLEECOCAR.Cells[4,1].AddNL(WVENTESQDI.Text +'mm' ,0,1);
end;
if (WATRIAOR.Value <> 0) then
begin
TABLEECOCAR.Cells[1,2].AddNL(REFAO.Caption,6,1);
end;
if (WATRIESQ.Value<>0)then
begin
TABLEECOCAR.Cells[2,2].AddNL(REFAE.Caption,6,1);
end;
if (WVENTDIR.Value<>0)then
begin
TABLEECOCAR.Cells[3,2].AddNL(REFVD.Caption,6,1);
end;
if (WVENTESQDI.Value <> 0 ) then
begin
TABLEECOCAR.Cells[4,2].AddNL(REFVED.Caption,6,1);
end;
if (WVENTESQSI.Value <> 0 ) then
begin
TABLEECOCAR.Cells[1,3].AddNL('V.E.(Sístole)',6,0);
TABLEECOCAR.Cells[1,4].AddNL(WVENTESQSI.Text +'mm',0,1);
end;
if WSEPTO.Value <> 0 then
begin
TABLEECOCAR.Cells[2,3].AddNL('Septo',6,0);
TABLEECOCAR.Cells[2,4].AddNL(WSEPTO.Text +'mm' ,0,1);
end;
if (WPPVENTESQ.Value <> 0) then
begin
TABLEECOCAR.Cells[3,3].AddNL('Par. post. V.E.',6,0);
TABLEECOCAR.Cells[3,4].AddNL(WPPVENTESQ.Text +'mm' ,0,1);
end;
if WSEPTO.Value <> 0 then
begin
TABLEECOCAR.Cells[2,5].AddNL(REFSEPTO.Caption,6,1);
end;
if (WPPVENTESQ.Value <> 0) then
begin
TABLEECOCAR.Cells[3,5].AddNL(REFPPVE.Caption,6,1);
end;
TABLEECOCAR.BestWidth := -90;
DBSRichViewEdit1.RichViewEdit.InsertItem('',TABLEECOCAR);
DBSRichViewEdit1.RichViewEdit.InsertBreak(0,rvbsLine,clWindowText);
You can see by yourself the error.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 20
- Joined: Fri Jun 03, 2011 8:33 pm