Sum Row on Grid

Pon

Well Known Member
Hi List,

Lack of quality sleep has cost me a good portion of my intelligence. I can't seem to remember how to make a sum row on a grid (the row at the bottom that will total the amounts in the columns). I've done it before and, have notes & manuals somewhere that detail the steps involved. However, I can't find them and, my memory fails me. Can anyone help me out here?!?

Thanks.
 
Pon,

Yeah, we all go through those times when our brains just don't remember things. As for adding a sum row...very easy:

I do it in the 'Last Record has been read' event

1) do system function: Set Grid Font (if you want different font for sum row...bold, color, etc)

2) set grid buffer (GB) values for those columns that will contain data in your row

3) do system function: Insert Grid Buffer Row (,after last row,,,,,) I usually set the clear parm to 'yes'

That should be all you need. Of course, you must keep track of your totals as you go. If you want the Sigma sign in your row header, do a system function: Set Grid Row Bitmap before the 'insert...' function call.

Good luck
 
That's it!!! That's the functionality I remember using! Whew, that was killing me. Thanks so much for you help Jeremy.

Thank God it's Friday!

P.S. I'd also like to thank Vince who chimed in with the same solution (via personal e-mail) about the same time as Jeremy.
 
Hello JMR,
I am new to JDE,and I want to do the same.
Can you please expand your post a little bit.
 
Yes. I could do the same.

1. On EVENT: Dialog is Initialized, initialize the sum variable like frm_Total_MathNumeric01 = 0
2. On EVENT: Grid Record is Fetched, add the variable with business column(BC). We must use business column here because at this event value has not written to grid
frm_Total_MathNumeric01 = [VA frm_Total_MathNumeric01]+[BC Amount - Order (F5543PR) Gross]
3. On EVENT: Last Grid Record Has Been Read, add a row to the grid with the sum variable
GB PRAmount = [VA frm_Total_MathNumeric01]
Insert Grid Buffer Row(FC Grid, <After Current Row>, <No>, <No>, <No>, <No>, <No>)
 
Hi Rauf,

Doing the accumulation in event 'Grid Record is Fetched' works fine as long as 'Suppress Grid Line' is not used (Otherwise you'll also be accumulating for rows which are fetched, but eventually not shown in the grid). So to be safe & future-proof, do your accumulation in event Write Grid Line Before/After.

Furthermore, if you're gonna use VA-variable(s) to hold the totals as you do in your example, don't forget to reset them in the Find Button - Button clicked event.
 
1. Yes. I changed the accumulation to Write Grid Line Before/After
2. I use 'Automatically Find on Entry'. So where should I write code to reset the variable ?
 
Dialog is Initialized will do for the initial population of the grid as a result of 'Auto Find on Entry' after the initial form entry; The reset in the Find Button Clicked event is needed because user can click the Find button after changing selection criteria (FC filterfields, QBE, ...).
 
Hi Remo,
I am facing same issue , i have written the code as below.
It doesn't show me total for last order in the details records when we select Total option.It doesn't consider that row at the time of total summarization.
 

Attachments

  • 182610-Write Grid line before.txt
    8.1 KB · Views: 287
Had a quick look. If this is all your "Level Break Processing" code, then it looks like you're forgetting to process the last "set" of records. This code will not trigger for that last set. You need to process that last set in the "Last Grid Rec Has Been Read" event. Basically, what you need to do there is to repeat the same logic to insert the proper total line, but this time without the check of current vs previous values (I.e.: VA frm_Save_xxx vs BC-value). Let me know if this solves it for you.
 
In a somewhat related vein, I've created an enhancement request in the Quest user group online enhancement tool, requesting the ability to select a range or set of cells, and do an auto-sum right in the grid.

I know that we have people in our Finance department that would love this functionality. If you're interested in adding your vote to prioritize this enhancement request, you can do so by voting on enhancement request # 10915. You can also enter comments.

To find the enhancement, once you log into the Quest website (questdirect.org), click on Community, and then Enhancements. Enter "auto-sum" in the search field to find this enhancement request.

Thanks!
 
Hi,
I'm a fresher and new to JDE. Could you please explain me how to total the AMOUNT EXTENDED PRICE column in F4211.
 
Hello, all this seems to be more from a Developer stand point, is there something that can be done with the sigma icon from the web part only?
 
Back
Top