cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting display of numbers in tables

mh97
Contributor
0 Kudos

I am trying to reproduce a model in VC 7.1 that was previously built in VC 7.0. I have the requirement to format numbers (such as, number of decimals, and percentage sign), and the table cells based on the values (e.g. cell background = light red when number is negative).

I was able to do this in VC 7.0 by settings in the "Styles" and "Formatting" tabs of the "Control Properties" dialog. However I cannot find similar options in VC 7.1! Can someone tell me where I can find these, or suggest how else I should approach this requirement?

We are using VC 7.1 SP5.

Thanks for any assistance anyone can provide.

Margaret

Accepted Solutions (0)

Answers (2)

Answers (2)

mh97
Contributor
0 Kudos

I am closing this question because it appears the functions I am looking for are simply unavailable in the current version of 7.1. Hopefully they will be available in a new version, soon.

mh97
Contributor
0 Kudos

Okay, I figured out for myself how to format a number as a percentage, EXCEPT now my percentage values show up as left-justified (like text) instead of right-justified, and I can't find out how to correct that.

To get the percentage formatting I used NSTR(<expression that gets the value>, ".0%") in the "Value" field of the Configure panel. That gave me the correct representation, except that it is now left-justified in one table. (Funny, I did the same thing on a column in another table, and it is still right-justifed. Hmmm.)

To try to force it to right-justify I thought I might tell it to treat it like a number anyway, by putting NVAL in front of the NSTR expression, but then it just returned blanks in that column. (I guess the % sign makes NVAL think there isn't a number there at all?)

And I still have no idea how to handle the table cell formatting.

I feel like I must be doing this all wrong. I hope someone has some ideas...

Former Member
0 Kudos

Hi Margaret,

Unfortunately, almost everything available in the "Styles and Formatting" tab of Visual Composer 7.0 is not yet available in Visual Composer 7.1.

The ability to align controls in grids is also not available in 7.1. However, I think maybe you can use the LPAD function in the control's value attribute to mimic this behavior - it's not an elegant solution, but it might work for you. To do this you would match the len attribute to the expected column width, so that it appears right-justified. Unfortunately, if the window is resized, it may end up looking pretty ugly, because the seemingly right-justified controls will be in the center of the column. In addition, because this means using an expression for the control's value property, the control will be read-only. But it's the only idea I have right now, and if the application is meant to be/likely to be used in a fixed size window, it might be OK.

Good luck,

Eyal

Edited by: Eyal Allweil on Apr 17, 2008 1:46 PM

mh97
Contributor
0 Kudos

Thank you for your reply, Eyal. Sorry to take so long to respond.

It's unfortunate that the output formatting capabilities seem to be so poor in 7.1 For now I have gone back to working with 7.0, although I can see some great benefit in 7.1 for initial prototyping.

Your suggestion of using the LPAD function, etc, seems like it will be helpful in some situations, although it did not solve my immediate problem. Thank you for the suggestion.

Margaret