Custom formating of negative numbers in a grid

shackallen

Member
Hello,

I am trying to format amounts in a grid so that if they are negative the are encapsulated in parenthesis and red. I am able to change the font no problem using event rules so making it red is not an issue. I do not want to convert to a string because it is a field users filter using QBE ex. >1000. I have seen some mention of doing a data dictionary override and formatting using a business function. Are there any business functions that would format negative numbers this way?

Thank you!
 

Larry_Jones

Legendary Poster
Good luck Shack.

The different numeric formats JDE will display as number as are listed in UDC 98/EC.
Parens and Colors are not part of that list.

Curious ... has changing the Font in ER actually worked for you?
 

BOster

Legendary Poster
I am not sure of an existing business function but I have written custom ones used as a DD override that format numbers in various ways including things like (1,234.99). If you create a DD format override BSFN you simply need to define a BSFN with the following DS:

Code:
typedef struct tagDSD5800012A
{
  ID                idBhvrErrorId;                       
  JCHAR              szBehaviorEditString[51];            
  JCHAR              szDescription001[31];                
  MATH_NUMERIC      mnGenericNumeric;                    
} DSD5800012A, *LPDSD5800012A;

The number will be passed in mnGenericNumeric and you return the formatted display in szBehaviorEditString. Formatting numbers as (1,234.99) works great for display only. I seem to remember some issues in an editable grid or maybe even in the QBE line... but I can't remember 100%... just seemed like I did run into an issue or two when using some custom number format other than the built in ones?????
 

johndanter

Legendary Poster
Why don't you give the user the same filter but in the header?

Then use Grid Records is Fetched to both format your new text column and perform the filtering based what they entered.
Check if the first digit is > or < etc and perform the event rule filtering in dedicated IFs
 
Top