Bank Payment Voucher Entry

abhinavmehraabhinavmehra Member Posts: 34
Hi All...

I need the solution for printing every Narration Line Description in Bank Payment Voucher Report

I written this code

RecNarration.RESET;
RecNarration.SETRANGE(RecNarration."Journal Template Name",GenJnlLine."Journal Template Name");
RecNarration.SETRANGE(RecNarration."Journal Batch Name",GenJnlLine."Journal Batch Name");
RecNarration.SETRANGE(RecNarration."Document No.",GenJnlLine."Document No.");
RecNarration.SETRANGE(RecNarration."Gen. Journal Line No.",GenJnlLine."Line No.");
IF RecNarration.FINDSET THEN
FOR k:=1 TO 8 DO
BEGIN
Line:=RecNarration."Line No.";
NarrationDes[k]:=RecNarration.Narration;
Line+=RecNarration."Line No.";
END;

but it will give only first line of record in 8 times...

I need every line will be print..

Please suggest me as soon as possible

Thanls to all

Comments

  • wrotbergwrotberg Member Posts: 4
    Hi,

    your code says:
    FOR k:=1 TO 8 DO
    BEGIN
    Line:=RecNarration."Line No.";
    NarrationDes[k]:=RecNarration.Narration;
    Line+=RecNarration."Line No.";
    END;

    But the bolded line does not give you the next line! Maybe you should try something like RecNarration.Next ?

    good luck
    wolfram
  • abhinavmehraabhinavmehra Member Posts: 34
    Now i tried this also....

    RecNarration.RESET;
    RecNarration.SETRANGE(RecNarration."Journal Template Name",GenJnlLine."Journal Template Name");
    RecNarration.SETRANGE(RecNarration."Journal Batch Name",GenJnlLine."Journal Batch Name");
    RecNarration.SETRANGE(RecNarration."Document No.",GenJnlLine."Document No.");
    RecNarration.SETRANGE(RecNarration."Gen. Journal Line No.",GenJnlLine."Line No.");
    {IF RecNarration.FINDSET THEN
    FOR k:=1 TO 8 DO
    BEGIN
    Line:=RecNarration."Line No.";
    NarrationDes[k]:=RecNarration.Narration;
    Line+=RecNarration."Line No.";
    END;
    }

    IF RecNarration.FINDSET THEN begin
    Repeat
    NarrationDes[k]:=RecNarration.Narration;
    until next=0;
    end;

    but not getting the result...

    Please give me the correct solution.....
  • vijay_gvijay_g Member Posts: 884
    Try it...
    K := 1;
    IF RecNarration.FINDSET THEN REPEAT
    NarrationDes[k]:=RecNarration.Narration;
    K+=1;
    until RecNarration.next=0;
    
Sign In or Register to comment.