NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: skyong38 on April 04, 2019, 11:42:14 PM

Title: Browse Total will reset if got few pages, any new solutions?
Post by: skyong38 on April 04, 2019, 11:42:14 PM
Hi,

I embeded the following code at Set Queue Record :-
        CASE T:DrCr
        OF 'D'
            LocDrAmt = T:Amount
            LocBalance += T:Amount
        OF 'C'
            LocCrAmt = T:Amount
            LocBalance -= T:Amount
        END
The LocBalance will reset every new page.

I search thru previous post on June 25, 2012, it can be solved by using File Load, but it will be very slow when records huge.

Just wonder, any new solution for this after so many years?

Thank you.

Regards,
Nelson
Title: Re: Browse Total will reset if got few pages, any new solutions?
Post by: Robert Iliuta on April 05, 2019, 12:52:45 AM
Hallo Nelson,

Just an idea, did you try to play with sessions?

CASE T:DrCr
        OF 'D'
            LocDrAmt = T:Amount
            LocBalance += T:Amount
            p_web.SSV('sv-LocBalance',LocBalance + p_web.GSV('sv-LocBalance'))
            LocBalance = p_web.GSV('sv-LocBalance')
        OF 'C'
            LocCrAmt = T:Amount
            LocBalance -= T:Amount
            p_web.SSV('sv-LocBalance',p_web.GSV('sv-LocBalance') - LocBalance)
            LocBalance = p_web.GSV('sv-LocBalance')
END

You need to reset the session variable when you open the form/browse.
I did not test but maybe will work/help you.

Robert
Title: Re: Browse Total will reset if got few pages, any new solutions?
Post by: Bruce on April 08, 2019, 02:09:30 AM
Hello Nelson,

What backend are you using? If SQL you could make a custom SQL statement to get the total.
If TPS you have to read all the records to calc the total, which as you noted could be slow.

cheers
Bruce

Title: Re: Browse Total will reset if got few pages, any new solutions?
Post by: skyong38 on April 08, 2019, 06:08:46 PM
Hi Robert,
 
Thanks for advice. Tried, doesn't works.


Hi Bruce,

I am using SQL, I will try on method you suggested.

Thank you.

Nelson
Title: Re: Browse Total will reset if got few pages, any new solutions?
Post by: DonRidley on April 09, 2019, 04:45:31 AM
Hello Nelson,

I'm also working with totals.  I'm doing some work with running balances as well.

The only thing I have found so far that consistently works, with decent speed, is using Views with very focused filters and keys.

I create my own local procedures, call the procedure, and get a return value.

I can honestly say, and you'll probably agree, totals and running balances are a pain the....well you know.  ;D

Don