News combit Dev Blog

Autosize for Column Widths

Posted: Thursday, July 11, 2019 | 2 comment(s)
 
Another step forward in our continuing quest to improve what's already great - our table object. Until LL25, you had to decide which widths you'd like to reserve for your respective columns. While this works out just nice most of the time, sometimes the result is less than perfect.

Depending on the data you're printing you get more whitespace than desireable, while causing wraps where you don't want them. In LL25, we'll introduce an autosize feature for column widths that is the perfect cure for this disease.

As an example, take the following customer list:


 

This is basically what happens if you drag and drop the three fields on the workspace. For clarity reasons I shrinked the second column just a bit. Now you might realize what's wrong here - the "City" column is way too wide compared to especially the "Address" column which causes excessive whitespace on the one hand side and unneccessary wraps on the other.

Enter the new autosize feature. While before you would have gone ahead and adjust the column widths manually until you found a reasonable fit, you can now rely on List & Label making the perfect decision for you. Based on the actual content. Due to the nature of this feature, it requires a data provider to be able to freely move through the data, i.e. it's supported for .NET, Delphi and C++ if you're using the available data provider implementations.

That said it's easy to use the new feature. Simply set the column widths to "0" to indicate you'd like to use automatic resizing:


If we leave everything at default, the result looks like this...


which is pretty cool. The available settings for autosize allow to fine tune the behavior:

Settings Purpose
Minimum Width Set the minimum width that should be used, even if the content wouldn't require it
Maximum Width Set the maximum width that should be used, even if the content is actually wider
Weighting This setting determines the whitespace ratio, i.e. which fraction of whitespace should be added to (or - if the aggregated column widths are greater than the table width - substracted from) the optimal width


The last setting is a bit tricky here - just as an example let's use "0" as weigthing for the first column, "2" for the second and "1" for the third. The result is then


Note how the first column just fits (i.e. weighting "0") while the second column receives the doubled amount of whitespace compared to the third. Plenty of stuff to play around with for the experts here while most of the time the defaults will work just fine. 




Author: Jochen Bartlau
Head of Development List & Label

Jochen Bartlau leads the development at combit as Managing Director. He's a Microsoft .NET enthusiast driving innovation & agile project management. The mobile devices geek who used to be a physicist in his first life loves to spend his spare time with his family.


  

RSS
combit Development BlogRSS
What’s this blog for?
A place to share updates about the ongoing development of our products. General musings on the software industry included.
Archive
March 2021 (1)
February 2021 (2)
January 2021 (1)
December 2020 (2)
November 2020 (1)
October 2020 (2)
September 2020 (1)
August 2020 (2)
July 2020 (1)
June 2020 (1)
May 2020 (2)
April 2020 (2)
March 2020 (2)
February 2020 (1)
January 2020 (1)
December 2019 (1)
November 2019 (2)
October 2019 (2)
September 2019 (2)
August 2019 (2)
July 2019 (2)
June 2019 (2)
May 2019 (1)
April 2019 (0)
April 2019 (1)
March 2019 (1)
February 2019 (1)
January 2019 (1)
December 2018 (1)
November 2018 (2)
October 2018 (4)
September 2018 (4)
August 2018 (2)
July 2018 (2)
June 2018 (2)
May 2018 (1)
April 2018 (1)
March 2018 (1)
February 2018 (2)
January 2018 (1)
December 2017 (1)
November 2017 (2)
October 2017 (3)
September 2017 (3)
August 2017 (2)
July 2017 (2)
June 2017 (1)
May 2017 (2)
April 2017 (1)
March 2017 (1)
February 2017 (1)
January 2017 (2)
December 2016 (1)
November 2016 (1)
October 2016 (4)
September 2016 (5)
August 2016 (2)
July 2016 (2)
June 2016 (3)
May 2016 (2)
April 2016 (3)
March 2016 (3)
February 2016 (1)
January 2016 (2)
December 2015 (2)
November 2015 (1)
October 2015 (4)
September 2015 (5)
August 2015 (2)
July 2015 (2)
June 2015 (2)
May 2015 (1)
April 2015 (2)
March 2015 (1)
February 2015 (1)
January 2015 (1)
December 2014 (2)
November 2014 (1)
October 2014 (1)
September 2014 (2)
August 2014 (1)
July 2014 (2)
June 2014 (1)
May 2014 (2)
April 2014 (1)
March 2014 (2)
+1 800 256 3608 (toll-free North America only)