LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone please help me autosize the columns on my table using labview? I already built my table; I just need to autosize the columns.

I tried Activex, but couldn't figure how to implement it in my code. Can someone please help?

I attached a VI and the excel file (TDMS) 

Download All
0 Kudos
Message 1 of 5
(2,498 Views)

Nothing attached.

This task will be difficult because it depends on the font style and size. If you know the maximum length of a column (because the contents are no more than a certain number of characters), I think it would be easier to just set the column width that way. 

aputman
0 Kudos
Message 2 of 5
(2,477 Views)

I just read a post about a function called "Get Text Rect".  This may help you get the size, in pixels, of a string of characters.  Then you can use that to set the column width. 

https://forums.ni.com/t5/LabVIEW/How-do-you-autosize-column-widths-in-a-multicolumn-listbox/td-p/318...

aputman
Message 4 of 5
(2,465 Views)

@aputman wrote:

I just read a post about a function called "Get Text Rect".  This may help you get the size, in pixels, of a string of characters.  Then you can use that to set the column width. 

https://forums.ni.com/t5/LabVIEW/How-do-you-autosize-column-widths-in-a-multicolumn-listbox/td-p/318...


That of course is the right answer!

 

Jean-Pierre was one of my early LV mentors.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 5
(2,423 Views)