Follow through the below steps. There's an easy way and a time consuming one too, see what works:
EASY (requires no logic, not recommended - use for triage purpose only):
In your current report extension, on OnAfterGetRecord of GL Entries dataitem. Or you can copy the default report into a new one and perform this there
1. If you know that the Number of approvers (Approval Sequence) is going to be less than 4, create 4 different variables
2. Now follow the below code and paste it
trigger OnAfterAfterGetRecord()
var
ApprovalEntry: Record "Posted Approval Entry";
begin
Clear(Approver1);
Clear(Approver2);
Clear(Approver3);
Clear(Approver4);
ApprovalEntry.Reset();
ApprovalEntry.SetRange("Document No.", "G/L Entry"."No.");
IF ApprovalEntry.FindSet() then
repeat
If ApprovalEntry."Sequence No." = 1 then
Approver1 := ApprovalEntry."Approver ID"
else
if ApprovalEntry."Sequence No." = 2 then
Approver2 := ApprovalEntry."Approver ID"
else
if ApprovalEntry."Sequence No." = 3 then
Approver3 := ApprovalEntry."Approver ID"
else
if ApprovalEntry."Sequence No." = 4 then
Approver4 := ApprovalEntry."Approver ID"
Until ApprovalEntry.Next() = 0;
end;
Print these 4 variables in 4 different text boxes in the report. The variables which do not have value will print blank
Challenging (requires logic & some understanding of report functioning in BC, recommended):
1. I'd recommend copy the default report and create a new one on a 50000 ID. If you do not know how to do that, do write back
2. In the copied report, add "Posted Approval Entries" as the child dataitem under G/L Entry & see if you can establish a DataItemLinkReference between GL Entry & Posted Approval Entries.
3. You do not need to write any code after DataItemLinkReference is specified. Read about it in MSDN blogs
4. Now declare columns for your Posted Approval Entries. In the report layout you may need to add a Sequence No subgroup to the GL Entry's original group
5. Run and see the report