Method Community

 

Formatting grid values?

Last post 05-16-2012 4:41 PM by Anonymous. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-10-2012 6:18 PM

    Formatting grid values?

    Hi all.

    I know that for individual fields placed on the screen, we have some control over the format of display, eg the number of decimal places for currency values. 

    Can I modify the display format of grid values? For example, the "Quantity" column of my Item grid displays with two decimal places ("4.00"), and I'd like it to only display the integer. 

  • 05-11-2012 10:26 AM In reply to

    Re: Formatting grid values?

    smohyee:
    Can I modify the display format of grid values?

    Not at this time, you would have to recreate the field in the table to adjust the decimal places.  See this post.

    ~C

  • 05-11-2012 11:27 AM In reply to

    Re: Formatting grid values?

    Answer

    Smohyee,

    You could use a SQL override here - I hadn't thought of this earlier but it is possible to override what's shown in a grid with this feature.

    ~C

  • 05-15-2012 12:46 PM In reply to

    Re: Formatting grid values?

    Chad, I'm not an SQL programmer, do you have a suggestion for the override script?

    From what I've read, SQL is not really designed for formatting displayed information, but the best functions I could find are CAST and CONVERT. The following script doesn't display any values in my quantity column:

    SELECT CAST(viewaccItem.QuantityOnHand AS INT) FROM viewaccItem (I also have different WHERE statements I've added to the end, based off your sript generator's recommondations)

     

     

  • 05-15-2012 4:02 PM In reply to

    Re: Formatting grid values?

    smohyee:
    do you have a suggestion for the override script?

    I know a little SQL but not enough to advise you on the script.  CONVERT is probably the function you want in this respect and the best I can do is link you to an MSDN article that explains this function a little more.  If you need help with writing the SQL you can definitely contact one of our consultants on this.

    ~C

  • 05-16-2012 4:41 PM In reply to

    Re: Formatting grid values?

    smohyee:
    do you have a suggestion for the override script?

    I got a tip from a team member here that if you use QuantityOnHand as your SQL Override on the item grid column for Quantity On Hand you'll have the display with no decimal places.

    ~C 

Page 1 of 1 (6 items)