Running Total in report
I am using below mentioned basic script to get running total in report
Dim RunSum as double
sub Page1OnBeforePrint(Sender)
RunSum=0
end sub
sub DsCustomerLedgerAmount1OnBeforePrint(Sender)
RunSum=RunSum+<DsCustomerLedger."Amount">
end sub
its working fine except variable set from delphi are not received by report
Requirements
1 - can some one tell me how to receive variables from delphi when basic script is being used
2 - what is the equivalent code of above mentioned in pascal script
Dim RunSum as double
sub Page1OnBeforePrint(Sender)
RunSum=0
end sub
sub DsCustomerLedgerAmount1OnBeforePrint(Sender)
RunSum=RunSum+<DsCustomerLedger."Amount">
end sub
its working fine except variable set from delphi are not received by report
Requirements
1 - can some one tell me how to receive variables from delphi when basic script is being used
2 - what is the equivalent code of above mentioned in pascal script
Comments
var
RunSum: double; //declare variable type could also be extended
begin
masterdata1OnBeforePrint(Sender); // use obp event of mdband
begin
RunSum=RunSum+<DsCustomerLedger."Amount">;
end;
begin
runsum:=0; // init variable this code is the first to be processed or use onbeginreport event.
end.
in the memoview use [RunSum]
However for any one else who want to use this code there is just a little correction
Instead of
RunSum=RunSum+<DsCustomerLedger."Amount">;
Use
RunSum:=RunSum+<DsCustomerLedger."Amount">;
and thanks for quick help