trichview.com

trichview.support




Tables


Return to index


Author

Message

ANNA

Posted: 07/05/2002 17:31:14


Hi Sergey,


Here what I try to do.


Add StringGrid1 buttons with RichViewEdit1 and style of course.


then,


procedure TForm1.BitBtn1Click(Sender: TObject); //From Delphi help file

var

  I, J, K : Integer;

begin

  K := 0;

  with StringGrid1 do

    for I := 0 to ColCount - 1 do

       for J:= 0 to RowCount - 1 do

         begin

           K := K + 1;

          Cells[I,J] := IntToStr(K);

        end;

end;


Then try to add StringGrid columns to RichViewEdit1.


procedure TForm1.BitBtn2Click(Sender: TObject);

var

  I, J, K : Integer;

  table: TRVTableItemInfo;

  r,c: Integer;

Begin

   for J:=0 to StringGrid1.RowCount -1 do

   begin

   for I := 0 to StringGrid1.ColCount - 1 do

   begin


  table := TRVTableItemInfo.CreateEx(1,1, RichViewEdit1.RVData);

  table.Color := clNone;

  table.BorderStyle := rvtbColor;

  table.CellBorderStyle := rvtbColor;


  table.BorderWidth := 1;

  table.BorderVSpacing := 1;

  table.VRuleWidth := 1;

  table.HRuleWidth := 1;

  for r := 0 to table.Rows.Count-1 do

  for c := 0 to table.Rows[r].Count-1 do begin

      table.Cells[r,c].BestWidth := 40;

      table.Cells[r,c].Clear;

      table.Cells[r,c].AddFmt(StringGrid1.Cells[I,J],[r,c],0,0); // Here I

have problem

      //Myline:=MyLine + Chr(9)+StringGrid1.Cells[I,J]; // this put each row

together

      table.Cells[r,c].DoJump(1);

      table.Cells[r,c].Color := clwhite;

    end;

      RichViewEdit1.InsertItem('', table);

    end;

//Insert new line to RichViewEdit1 or start new row.

   RichViewEdit1.InsertText(#10#13);

  end;

end;


Now I have problem to put all columns in same row into table.(Table beside

table for each row).






Powered by ABC Amber Outlook Express Converter