NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on September 21, 2012, 10:33:27 AM

Title: Totals only in the last page of the browse
Post by: Alberto 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
Title: Re: Totals only in the last page of the browse
Post by: kevin plummer 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.
Title: Re: Totals only in the last page of the browse
Post by: Alberto 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
Title: Re: Totals only in the last page of the browse
Post by: Bruce 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

Title: Re: Totals only in the last page of the browse
Post by: Alberto 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
Title: Re: Totals only in the last page of the browse
Post by: Bruce on September 24, 2012, 06:06:00 AM
that's probably quite difficult to do. (At least in Nt6).