Tables export to RTF problem

General TRichView support forum. Please post your questions here
Post Reply
imcnicoll
Posts: 4
Joined: Mon Nov 14, 2005 3:37 pm

Tables export to RTF problem

Post 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
imcnicoll
Posts: 4
Joined: Mon Nov 14, 2005 3:37 pm

Post by imcnicoll »

Oops - fixed it myself.

Adding the first line

LinesTable.BestWidth := 0

seems to fix things.

Ian :oops:
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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)
Post Reply