trichview.com

trichview.support




problem inserting tables in a report


Return to index


Author

Message

Paul

Posted: 02/24/2005 23:12:23


I am trying to use TRichView to generate from code a report containing

tables separated by text and various charts.  I am using the following code.

Procedure Create_Table creates a new table when needed.   (I adapted code

found in the RichView manual.)  The problem is that each new table is

inserted at the top of the document, and not after the previous line of text

(which is the end of the document, at least until I use code to insert more

text and tables).  How do I force a table to insert at the end of the

document?


Paul


-----------------------

procedure Create_Table(NumRow,NumCol:integer);

begin

  table1 := TRVTableItemInfo.CreateEx(NumRow,NumCol,frmMAIN.rve.RVData);

  table1.BorderStyle := rvtbColor;

  table1.CellBorderStyle := rvtbColor;

  table1.BorderWidth := 1;

  table1.BorderVSpacing := 0; table1.BorderHSpacing := 0;

  table1.CellBorderWidth := 1;

  table1.CellVSpacing := 0; table1.CellHSpacing := 0;

  rve.InsertItem('DecisionCharts',table1); // creates table1

  table1.Cells[0,0].BestWidth := -30;

  table1.BestWidth := -50;

end;


...

begin

   // add text ....

    rve.AddNL('text',0,0);

    rve.AddNL('more text',0,0);


    // create a table

    Create_Table(4,2);


    // fill in the cells of the table

    with table1.Cells[0,0] do begin Clear; AddNL('something',0,0); end;

    with table1.Cells[0,1] do begin Clear; AddNL('somethin else',0,0); end;

   {...and so on until filled}


   // add more text ....

    rve.AddNL('more text',0,0);

    rve.AddNL('even more text',0,0);


    // create another table

    Create_Table(6,2);


    // fill in the cells of the table

    with table1.Cells[0,0] do begin Clear; AddNL('something',0,0); end;

    with table1.Cells[0,1] do begin Clear; AddNL('somethin else',0,0); end;

   {...and so on until filled}


  // add more text, more tables, and charts





Powered by ABC Amber Outlook Express Converter