About subtotal by everypage

47114711 Member Posts: 15
i face a problem.
i use this codeunit to realize every page has 10 rows in the report which only has one dataitem integer.

IF Number = 1 THEN BEGIN
Test1.FIND('-');
i := 1;
END ELSE BEGIN

IF Test1.NEXT = 0 THEN
CurrReport.BREAK;

IF i = 10 THEN BEGIN
CurrReport.NEWPAGE;
i := 0;
END ;
i += 1;
END;


now i want to get a subtotal of a colum "Amount" in the record Test1 by every page ,how could i realize that?
Btw,I found that when i used function newpage,the section transfooter have no effect on the report.


Thank you for your help

Comments

  • ara3nara3n Member Posts: 9,257
    You should use Transfooters section. Is there a reason why you aren't using them?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • 47114711 Member Posts: 15
    i have used it,but it have no effect.
    so i think maybe i need to add some codeunit to realize that function.
  • 47114711 Member Posts: 15
    i have found the solution in the previous forum.
    only need to define two variable.TotalToDisplay,TotalToCalculate
    and then in the trigger foot-onpresection TotalToCalculate :=0;
    in the trigger onaftergetrecord
    TotalToCalculate += Test1.Amount;
    TotalToDisplay := TotalToCalculate;

    that will be ok.i think it's really very simple and useful.
    but i still misunderstand why the transfooter have no effect when used the function newpage.
  • DenSterDenSter Member Posts: 8,307
    Just adding a transfooter doesn't do the trick, you also have to set up the field to create totals, and the command is CREATETOTALS, and it goes in the Predataitem trigger I think.
  • 47114711 Member Posts: 15
    i have tested transfooter for many times.
    i also have used createtotal or property totalfield.even i only put a label in the tranfooter,but if i used newpage,it would be unavailable.
Sign In or Register to comment.