I make report to filter daily cash receipt and define two variables in c/al global and put them in request form
as folowing : StDate date , TXTBRANCH text 30
FinalSum:=0;
recgl.RESET;
IF TXTBRANCH =’’ THEN
recgl.SETRANGE(recgl.“G/L Account No.”,“G/L Account1”.“No.”);
recgl.SETRANGE(recgl.“Posting Date”,StDate);
recgl.SETRANGE(recgl.“Source Code”,“G/L Entry”.“Source Code”)
ELSE
recgl.SETRANGE(recgl.“G/L Account No.”,“G/L Account1”.“No.”);
recgl.SETRANGE(recgl.“Posting Date”,StDate);
recgl.SETRANGE(recgl.“Source Code”,“G/L Entry”.“Source Code”);
recgl.SETRANGE(recgl.“Global Dimension 1 Code”,TXTBRANCH) ;
IF recgl.FINDSET THEN
REPEAT
FinalSum:= FinalSum+recgl.“Credit Amount”;
UNTIL recgl.NEXT=0;
Debitsum := Debitsum+FinalSum;
IF FinalSum =0 THEN
CurrReport.SKIP;
what is wrong in this code
Use Begin End if you have multiple statements in IF condition
IF TXTBRANCH =’’ THEN BEGIN
recgl.SETRANGE(recgl.“G/L Account No.”,“G/L Account1”.“No.”);
recgl.SETRANGE(recgl.“Posting Date”,StDate);
recgl.SETRANGE(recgl.“Source Code”,“G/L Entry”.“Source Code”);
END;
i make as following but no benefit
FinalSum:=0;
recgl.RESET;
IF TXTBRANCH =’’ THEN begin
recgl.SETRANGE(recgl.“G/L Account No.”,“G/L Account1”.“No.”);
recgl.SETRANGE(recgl.“Posting Date”,StDate);
recgl.SETRANGE(recgl.“Source Code”,“G/L Entry”.“Source Code”) ;
end;
ELSE
begin
recgl.SETRANGE(recgl.“G/L Account No.”,“G/L Account1”.“No.”);
recgl.SETRANGE(recgl.“Posting Date”,StDate);
recgl.SETRANGE(recgl.“Source Code”,“G/L Entry”.“Source Code”);
recgl.SETRANGE(recgl.“Global Dimension 1 Code”,TXTBRANCH);
end;
IF recgl.FINDSET THEN
REPEAT
FinalSum:= FinalSum+recgl.“Credit Amount”;
UNTIL recgl.NEXT=0;
Debitsum := Debitsum+FinalSum;
IF FinalSum =0 THEN
CurrReport.SKIP;
Remove ; after end in below code
end;
ELSE
begin