Page 1 of 1

Tables export to RTF problem

Posted: Thu Aug 03, 2006 5:54 pm
by imcnicoll
Hi Sergey,

Excellent product but I have a small problem with this code:

LinesTable.BestWidth := 0;
LinesTable.InsertCols(0,LineColumns-1,0,false);
LinesTable.Cells[0,0].BestWidth := -29; //Description
LinesTable.Cells[0,1].BestWidth := -17; //Client Ref
LinesTable.Cells[0,2].BestWidth := -12; //Amount
LinesTable.Cells[0,3].BestWidth := -11; //Discount
LinesTable.Cells[0,4].BestWidth := -10; //Vat Rate
LinesTable.Cells[0,5].BestWidth := -9; //Vat Amount
LinesTable.Cells[0,6].BestWidth := -12; // Net Amount

This displays and prints perfectly in Richview but when an RTF file is created, the column widths collapse, so that the table becomes unreadable.

I have tried using fixed pixel widths but the RTF columns default to identical widths, whatever fgures are set in BestWidth.

Any suggestions?

Ian

Posted: Fri Aug 04, 2006 1:12 am
by imcnicoll
Oops - fixed it myself.

Adding the first line

LinesTable.BestWidth := 0

seems to fix things.

Ian :oops:

Posted: Fri Aug 04, 2006 12:05 pm
by Sergey Tkachenko
Actually, 0 is a default value for table.BestWidth.
It means default table width.
May be results will be better if you set it to -100 (i.e. 100% of page/window width)