LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

table data justification

Hello,

I'm using LabVIEW 7.0, and I need to populate some tables with data.  I can't seem to find a way to center justifiy the data in the table.  Did they really forget to include this ability?  Sounds like too much of an oversite for the folks at NI.  Does anyone know how to center justify the data in a table?

Thanks.

 

0 Kudos
Message 1 of 15
(3,641 Views)

In 2009 it is

 

Active Celll >>> Cell justification

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 15
(3,639 Views)
No such selection in 7.0.
0 Kudos
Message 3 of 15
(3,633 Views)

rickford66 wrote:
No such selection in 7.0.

 

Correct!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 15
(3,625 Views)

Do you need to center the data just for aesthetics, or for printing? If so, you can pad the strings with spaces to the left to center each cell.

If you know the expected maximum string length, it's not too difficult. You need to pad the strings with spaces to meet the minimum field length, then use split string (split it where the spaces start) and then reverse-concatenate (swap) the spaces on the end with the original characters. Something like that. I might have an example somewhere.

Richard






Message 5 of 15
(3,603 Views)

That sounds like it might work, but I'm new to this.  My immediate question is, how do I know how many character spaces it will hold.  I ask because it has been my experience that different characters take up different amount of space... so depending on what is being displayed, the amount of characters may vary.

 

BTW, I need this for printing.

0 Kudos
Message 6 of 15
(3,584 Views)

rickford66 wrote:

That sounds like it might work, but I'm new to this.  My immediate question is, how do I know how many character spaces it will hold.  I ask because it has been my experience that different characters take up different amount of space... so depending on what is being displayed, the amount of characters may vary.

 

BTW, I need this for printing.


On the "Picture Functions" pallette of LV 7.0 there is a function called "Get Text Rect.vi". If you pass it a string along with the font style and size you are using, it will return a cluster that defines the rectangle required to for that text.

 

You can use that VI to determine the size.

 

I can not speak for how easy this will be if you use a font with different widths. I believe there are fonts with fixed width out there somewhere.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 15
(3,575 Views)
I'm using Application Font which is set to Arial of some type, and the padding method looks fine on my computer. However, if you want true fixed width font, set it to Courier. The M is the same as the I as same as a space.
Richard






Message 8 of 15
(3,568 Views)

Here's an example I whipped up in version 9, but these functions should be available in version 7.

 

Message Edited by Broken Arrow on 04-13-2010 02:44 PM
Richard






Message 9 of 15
(3,560 Views)

Thanks for all your help.  I just (minutes ago) got taken off this part of the project and moved to a more "urgent" part of the project.  I will have to try that when I get back to it.  Thanks so much.

Rick

0 Kudos
Message 10 of 15
(3,552 Views)