Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8382285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:53:48+00:00 2026-06-09T16:53:48+00:00

Is there an example anywhere of a form that performs running totals in a

  • 0

Is there an example anywhere of a form that performs running totals in a column located within a grid. The user ordering and filtering of the grid would affect the running totals column.

I can easily perform the above if it was ordering only by transaction date, but including the user ordering and filtering I presume that we would have to use the datasource range() and rangecount() functions (see SysQuery::mergeRanges() for an example) then iterate over these to apply the filtering, then include the dynalinks. The same for the ordering, albeit this is now more complicated.

Any suggestions appreciated. Any appreciations suggested (as in: vote the question up!).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:53:50+00:00Added an answer on June 9, 2026 at 4:53 pm

    You could implement it as a form datasource display method using this strategy:

    1. Copy the form’s datasource query (no need for SysQuery::mergeRanges):

      QueryRun qr = new QueryRun(ledgerTrans_qr.query());

    2. Iterate and sum over your records using qr, stop after the current record:

      while (qr.next())
      {
      lt = qr.getNo(1);
      total += lt.AmountMST;
      if (lt.RecId == _lt.RecId)
      break;
      }

      This could be made more performant if the sorting order was fixed (using sum(AmountMST) and adding a where constraint).

    3. Return the total

    This is of cause very inefficient (subquadratic time, O(n^2)).

    Caching the results (in a map) may make it usable if there are not too many records.

    Update: a working example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an example of a bitmap color replacement implementation that actually works? I'm
Is there a working example anywhere of how to create a meeting request using
ScalaForms In the example linked here there is this example about form validation: //
Is there any example on how to implement a simple login page/dialog? I have
Is there an example of an OAuth implementation or profile which uses multiple authorization
is there any example on using java method to call rhino-javascript function and return
Is there any example on DOS Batch - Find and Replace command for files?
Is there any example for a Real Time Chart using the DexExpress in ASP.Net?
Lets say for example there are 5 records shown on screen. I want the
There is an example on php.net how to get last two domain segments in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.