Page 1 of 1
Set table columns best fit
Posted: Fri May 12, 2017 8:11 am
by vit
Hello!
I have a table that has columns much wider that it's necessary. Is there a way to reduce some of columns width (starting from index=3) so that a width on each of them is only enough to include a content w/o extra space?
- TableBestFit.png (9.49 KiB) Viewed 25074 times
Thanks!
Re: Set table columns best fit
Posted: Fri May 12, 2017 7:25 pm
by Sergey Tkachenko
BestFit option is not implemented yet, sorry.
I can suggest assigning minimal BestWidth to columns, and include rvpaoNoWrap in Options of paragraph style used in this table.
Re: Set table columns best fit
Posted: Sat May 13, 2017 12:20 am
by vit
Including rvpaoNoWrap in Options for the table's ParaStyle will put the cell's content in one line, which may make column wider, right? I do not want it for all cells, for example, I don't want it at first three columns. Does it mean that I should set rvpaoNoWrap for the all cells that don't contain multiline content?
Re: Set table columns best fit
Posted: Sat May 13, 2017 5:48 am
by Sergey Tkachenko
I think for this table it's enough to make no-wrap header cells
Re: Set table columns best fit
Posted: Mon May 15, 2017 9:27 am
by vit
Table behaves strangely, columns get very wide.
I prepared a demo project that'll help you to see the table and what I'm trying to do. Could you look at it?
Just be sure that file Table.rvf is placed at the same path as Project1.exe. Run it (you'll see the table in initial state) and push the bSetColumnsWidth button
SRV_VERSION = 'v7.2.1';
RVE v16.3.1
Re: Set table columns best fit
Posted: Wed May 17, 2017 10:08 am
by Sergey Tkachenko
Hello,
This table has a large table.BestWidth assigned.
You set minimal widths for cells in all columns starting from the 4th.
As a result, the table has the same large width as before, but the first 3 columns occupy maximal possible space, and the rest of columns occupy minimal possible space.
To see what happens, assign after loading RVF (so the table is displayed completely):
Code: Select all
SRVE.PageProperty.Orientation := poLandscape;
SRVE.PageProperty.PageFormat := srvfmA3;