NetTalk Central

Author Topic: Totals only in the last page of the browse  (Read 2073 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1849
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Totals only in the last page of the browse
« on: September 21, 2012, 10:33:27 AM »
Hi,
I need to add some lines of totas but only in the last page of the Browse.
How can I do it?

And... Is there any way to add calculated rows as subtotals between browse lines?

THanks
-----------
Regards
Alberto

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Totals only in the last page of the browse
« Reply #1 on: September 23, 2012, 02:54:52 AM »
sounds like you need to create a temp file with all the extra total line you want added in.

Alberto

  • Hero Member
  • *****
  • Posts: 1849
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Totals only in the last page of the browse
« Reply #2 on: September 23, 2012, 06:57:01 AM »
Nop, the creation of the temp file will last many minutes until it could be browsed and I think theres no need having the BrowseRow and the Total procedures.
I only need some basic instruction of how to use this procs to add lines and to show thw total only in the last page.
Thanks
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Totals only in the last page of the browse
« Reply #3 on: September 24, 2012, 12:11:28 AM »
Hi Alberto,

your task can be broken down into a number of smaller tasks;

a) know if the user is looking at the "last page".
b) calculate the totals
c) display the totals.

a) Fortunately there is a local variable, loc:nextdisabled, which is set if the user is on the last page of the browse.

b) Since you are calculating the totals over more than just the page, you will need a function to calculate them. Say you were totalling the "size" as represented by one column. Then you could create a local variable say total:size, and populate that with a function.  For example;

if loc:NextDisabled
  BuildTotal(total:size,total:amount)
end

c) In the "condition" for the total field put
loc:NextDisabled

Cheers
Bruce


Alberto

  • Hero Member
  • *****
  • Posts: 1849
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Totals only in the last page of the browse
« Reply #4 on: September 24, 2012, 03:51:16 AM »
Thanks Bruce, very usefull

And... what if I need to add SubTotal lines between browse rows?

How can I do it?

THanks
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Totals only in the last page of the browse
« Reply #5 on: September 24, 2012, 06:06:00 AM »
that's probably quite difficult to do. (At least in Nt6).